AnonSec Shell
Server IP : 144.76.79.100  /  Your IP : 216.73.216.103   [ Reverse IP ]
Web Server : Apache
System : Linux ch05.wehostwebserver.com 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User : razzlestore ( 1092)
PHP Version : 8.2.29
Disable Function : NONE
Domains : 343 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/public_html/cleaning/owl/test/unit/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/public_html/cleaning/owl/test/unit/autoplay.js
module('Autoplay tests');

function FakeClock() {
	// Instantiate a new controllable clock which overrides the built in Date
	// class on construction.
	var value = 1;

	this.tick = function(duration) {
		value += duration;
	};
	// TODO: This is broken and has to be fixed in the near future
	this.Date = function() {
		this.getTime = function() {
			return value;
		}
	}
}

function change_timeout(autoplay, first, second, wait) {
	var clock = new FakeClock();

	// This is a helper function to test multiple consecutive play calls with
	// different timeout values. Four steps will be completed by this function:

	// 1. The autoplay will be played in a stopped state with the first timeout.
	autoplay.stop();
	autoplay.play(first);

	// 2. Time will be forwarded a given wait time.
	clock.tick(wait);

	// 3. The autoplay will be paused.
	autoplay.pause();

	// 4. The autoplay will be played with the second timeout.
	autoplay.play(second);
}

// test('stopping the autoplay timer', function() {
// 	expect(2);
//
// 	var clock = new FakeClock();
//
// 	var carousel = $('#simple').owlCarousel().data('owl.carousel');
// 	var autoplay = carousel._plugins.autoplay;
//
// 	clock.tick(1);
//
// 	autoplay.stop();
// 	autoplay.play();
//
// 	equal(autoplay.read(), 0);
//
// 	autoplay.pause();
// 	autoplay.play();
//
// 	equal(autoplay.read(), 0);
// });
// TODO: See todo above, seems to be broken since a while as we are trying to assign the global const Date to a new function
// test('changing autoplay timeout values', function() {
// 	expect(4);
//
// 	var carousel = $('#simple').owlCarousel().data('owl.carousel');
// 	var autoplay = carousel._plugins.autoplay;
//
// 	// Changing the timeout from 2000 to 3000 after 3000 ticks should maintain
// 	// the elapsed time (1000) since the last transition.
// 	change_timeout(autoplay, 2000, 3000, 3000);
// 	equal(autoplay.read() % 3000, 1000);
//
// 	// Changing the timeout from 4000 to 5000 after 12000 ticks should maintain
// 	// the elapsed time (0) since the last transition.
// 	change_timeout(autoplay, 4000, 5000, 12000);
// 	equal(autoplay.read() % 5000, 0);
//
// 	// Changing the timeout from 5000 to 4000 after 12000 ticks should maintain
// 	// the elapsed time (2000) since the last transition.
// 	change_timeout(autoplay, 5000, 4000, 12000);
// 	equal(autoplay.read() % 4000, 2000);
//
// 	// Changing the timeout from 11000 to 6000 after 19000 ticks should reset
// 	// the elapsed timer value (7000) since the last transition to 0, because
// 	// it is larger than the timeout value.
// 	change_timeout(autoplay, 11000, 6000, 19000);
// 	equal(autoplay.read() % 6000, 0);
// });

Anon7 - 2022
AnonSec Team