qunit-1.17.1.js revision 89092dc10fe08b037266c0b4efb94b221f6fffb3
/*!
* QUnit 1.17.1
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
*
* Date: 2015-01-20T19:39Z
*/
(function( window ) {
var QUnit,
loggingCallbacks = {},
// Keep a local reference to Date (GH-283)
Date = window.Date,
return new Date().getTime();
},
globalStartCalled = false,
runStarted = false,
defined = {
sessionStorage: (function() {
var x = "qunit-test-string";
try {
sessionStorage.setItem( x, x );
sessionStorage.removeItem( x );
return true;
} catch ( e ) {
return false;
}
}())
},
/**
* Provides a normalized error string, correcting an issue
* with IE 7 (and prior) where Error.prototype.toString is
* not properly implemented
*
* Based on http://es5.github.com/#x15.11.4.4
*
* @param {String|Error} error
* @return {String} error message
*/
errorString = function( error ) {
} else if ( name ) {
return name;
} else if ( message ) {
return message;
} else {
return "Error";
}
} else {
return errorString;
}
},
/**
* Makes a clone of an object using only Array or Object as base,
* and copies over the own enumerable properties.
*
* @param {Object} obj
* @return {Object} New object with only the own properties (recursively).
*/
objectValues = function( obj ) {
}
}
return vals;
};
QUnit = {};
/**
* Config object: Maintain internal state
* Later exposed as QUnit.config
* `config` initialized at top of scope
*/
config = {
// The queue of tests to run
queue: [],
// block until document ready
blocking: true,
// by default, run previously failed tests first
// very useful in combination with "Hide passed tests" checked
reorder: true,
// by default, modify document.title when suite is done
altertitle: true,
// by default, scroll to top of the page when suite is done
scrolltop: true,
// when enabled, all tests must call expect()
requireExpects: false,
// add checkboxes that are persisted in the query-string
// when enabled, the id is set to `true` as a `QUnit.config` property
urlConfig: [
{
id: "hidepassed",
label: "Hide passed tests",
tooltip: "Only show tests and assertions that fail. Stored as query-strings."
},
{
id: "noglobals",
label: "Check for Globals",
tooltip: "Enabling this will test if any test introduces new properties on the " +
"`window` object. Stored as query-strings."
},
{
id: "notrycatch",
label: "No try-catch",
tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging " +
"exceptions in IE reasonable. Stored as query-strings."
}
],
// Set of all modules.
modules: [],
// The first unnamed module
name: "",
tests: []
},
callbacks: {}
};
// Push a loose unnamed module to the modules collection
// Initialize more QUnit.config and QUnit.urlParams
(function() {
var i, current,
urlParams = {};
if ( params[ 0 ] ) {
for ( i = 0; i < length; i++ ) {
// allow just a key to turn on a flag, e.g., test.html?noglobals
} else {
}
}
}
}
// String search anywhere in moduleName+testName
// Ensure that urlParams.testId is an array
}
}
// Figure out if we're running the tests from a server or not
}());
// Root QUnit object.
// `QUnit` initialized at top of scope
// call on start of module test to prepend name to all tests
var currentModule = {
tests: []
};
// beforeEach and afterEach should be used instead
delete testEnvironment.setup;
}
delete testEnvironment.teardown;
}
},
// DEPRECATED: QUnit.asyncTest() will be removed in QUnit 2.0.
expected = null;
}
},
var test;
expected = null;
}
});
},
skip: true
});
},
// DEPRECATED: The functionality of QUnit.start() will be altered in QUnit 2.0.
// In QUnit 2.0, invoking it will ONLY affect the `QUnit.config.autostart` blocking behavior.
globalStartCalled = true;
if ( runStarted ) {
throw new Error( "Called start() outside of a test context while already started" );
throw new Error( "Called start() outside of a test context too many times" );
throw new Error( "Called start() outside of a test context when " +
"QUnit.config.autostart was true" );
} else if ( !config.pageLoaded ) {
// The page isn't completely loaded yet, so bail out and let `QUnit.load` handle it
return;
}
} else {
// If a test is running, adjust its semaphore
// Don't start until equal number of stop-calls
return;
}
// throw an Error if start is called more often than stop
"Called start() while already started (test's semaphore was 0 already)",
sourceFromStacktrace( 2 )
);
return;
}
}
},
// DEPRECATED: QUnit.stop() will be removed in QUnit 2.0.
// If there isn't a test running, don't allow QUnit.stop() to be called
throw new Error( "Called stop() outside of a test context" );
}
// If a test is running, adjust its semaphore
},
// Safe object type checking
},
objectType: function( obj ) {
if ( typeof obj === "undefined" ) {
return "undefined";
}
// Consider: typeof null === object
if ( obj === null ) {
return "null";
}
switch ( type ) {
case "Number":
return "nan";
}
return "number";
case "String":
case "Boolean":
case "Array":
case "Date":
case "RegExp":
case "Function":
return type.toLowerCase();
}
if ( typeof obj === "object" ) {
return "object";
}
return undefined;
},
load: function() {
config.pageLoaded = true;
// Initialize the configuration options
started: 0,
updateRate: 1000,
autostart: true,
filter: ""
}, true );
}
}
});
// Register logging callbacks
(function() {
var i, l, key,
"moduleStart", "moduleDone" ];
function registerLoggingCallback( key ) {
var loggingCallback = function( callback ) {
throw new Error(
"QUnit logging methods require a callback function as their first parameters."
);
}
};
// DEPRECATED: This will be removed on QUnit 2.0.0+
// Stores the registered functions allowing restoring
// at verifyLoggingCallbacks() if modified
return loggingCallback;
}
// Initialize key collection of logging callback
}
}
})();
// `onErrorFnPrev` initialized at top of scope
// Preserve other handlers
// Cover uncaught exceptions
// Returning true will suppress the default browser handler,
// returning false will let it run.
var ret = false;
if ( onErrorFnPrev ) {
}
// Treat return value as window.onerror itself does,
// Only do our handling if not suppressed.
if ( ret !== true ) {
return true;
}
} else {
}, { validTest: true } ) );
}
return false;
}
return ret;
};
function done() {
// Log the last module results
if ( config.previousModule ) {
runLoggingCallbacks( "moduleDone", {
});
}
delete config.previousModule;
runLoggingCallbacks( "done", {
});
}
// Doesn't support IE6 to IE9
function extractStacktrace( e, offset ) {
if ( e.stacktrace ) {
// Opera 12.x
} else if ( e.stack ) {
// Firefox, Chrome, Safari 6+, IE10+, PhantomJS and Node
}
if ( fileName ) {
include = [];
break;
}
}
}
}
} else if ( e.sourceURL ) {
// Safari < 6
// exclude useless self-reference for generated Error objects
return;
}
// for actual exceptions, this is useful
}
}
function sourceFromStacktrace( offset ) {
var e = new Error();
if ( !e.stack ) {
try {
throw e;
} catch ( err ) {
// This should already be true in most browsers
e = err;
}
}
return extractStacktrace( e, offset );
}
}
return;
}
}
}
function next() {
}
// Reset async tracking for each phase of the Test lifecycle
}
} else {
break;
}
}
done();
}
}
function begin() {
var i, l,
modulesLog = [];
// If the test run hasn't officially begun yet
// Record the time of the test run's beginning
// Delete the loose unnamed module if unused.
}
// Avoid unnecessary information by not logging modules' test environments
});
}
// The test run is officially beginning now
runLoggingCallbacks( "begin", {
});
}
process( true );
}
function resumeProcessing() {
runStarted = true;
// A slight delay to allow this iteration of the event loop to finish (more assertions, etc.)
if ( defined.setTimeout ) {
setTimeout(function() {
return;
}
}
begin();
}, 13 );
} else {
begin();
}
}
function pauseProcessing() {
} else {
throw new Error( "Test timed out" );
}
}, config.testTimeout );
}
}
function saveGlobal() {
// in Opera sometimes DOM element ids show up here, ignore them
continue;
}
}
}
}
}
function checkPollution() {
var newGlobals,
saveGlobal();
}
}
}
// returns a new Array with the elements that are in a but not in b
function diff( a, b ) {
var i, j,
for ( j = 0; j < b.length; j++ ) {
if ( result[ i ] === b[ j ] ) {
i--;
break;
}
}
}
return result;
}
for ( var prop in b ) {
// Avoid "Member not found" error in IE8 caused by messing with window.constructor
delete a[ prop ];
}
}
}
}
return a;
}
var i, l, callbacks;
}
}
// DEPRECATED: This will be removed on 2.0.0+
// This function verifies if the loggingCallbacks were modified by the user
// If so, it will restore it, assign the given callback and print a console warning
function verifyLoggingCallbacks() {
var loggingCallback, userCallback;
for ( loggingCallback in loggingCallbacks ) {
// Restore the callback function
// Assign the deprecated given callback
"Please, check out the documentation on how to apply logging callbacks.\n" +
"Reference: http://api.qunitjs.com/category/callbacks/"
);
}
}
}
}
// from jquery.js
}
return i;
}
}
return -1;
}
var i, l;
this.assertions = [];
this.semaphore = 0;
this.usedAsync = false;
// Register unique strings
this.testName += " ";
}
}
});
// Skipped tests will fully ignore any sent callback
this.callback = function() {};
this.async = false;
this.expected = 0;
} else {
}
}
before: function() {
if (
// Emit moduleStart when we're switching from one module to another
// They could be equal (both undefined) but if the previousModule property doesn't
// yet exist it means this is the first test in a suite that isn't wrapped in a
// module, in which case we'll just emit a moduleStart event for 'undefined'.
// Without this, reporters can get testStart before moduleStart which is a problem.
) {
runLoggingCallbacks( "moduleDone", {
});
}
runLoggingCallbacks( "moduleStart", {
});
}
delete this.testEnvironment.beforeEach;
delete this.testEnvironment.afterEach;
runLoggingCallbacks( "testStart", {
});
saveGlobal();
}
},
run: function() {
var promise;
if ( this.async ) {
}
this.callbackStarted = now();
if ( config.notrycatch ) {
this.resolvePromise( promise );
return;
}
try {
this.resolvePromise( promise );
} catch ( e ) {
// else next test will carry the responsibility
saveGlobal();
// Restart the tests if they're blocking
}
}
},
after: function() {
},
var promise,
test = this;
return function runHook() {
if ( config.notrycatch ) {
return;
}
try {
} catch ( error ) {
}
};
},
// Currently only used for module level hooks, can be used to add global level ones
var hooks = [];
// Hooks are ignored on skipped tests
if ( this.skip ) {
return hooks;
}
if ( this.module.testEnvironment &&
}
return hooks;
},
finish: function() {
this.pushFailure( "Expected number of assertions to be defined, but expect() was " +
"not called.", this.stack );
this.pushFailure( "Expected at least one assertion, but none were run - call " +
"expect(0) to accept zero assertions.", this.stack );
}
var i,
bad = 0;
if ( !this.assertions[ i ].result ) {
bad++;
}
}
runLoggingCallbacks( "testDone", {
// HTML Reporter use
assertions: this.assertions,
// DEPRECATED: this property will be removed in 2.0.0, use runtime instead
});
// QUnit.reset() is deprecated and will be replaced for a new
// fixture reset function on QUnit 2.0/2.1.
// It's still called here for backwards compatibility handling
},
queue: function() {
var bad,
test = this;
if ( !this.valid() ) {
return;
}
function run() {
// each of these can by async
function() {
},
function() {
},
function() {
},
function() {
}
]);
}
// `bad` initialized at top of scope
// defer when previous test run passed, if storage is available
if ( bad ) {
run();
} else {
synchronize( run, true );
}
},
var source,
details = {
};
if ( !result ) {
if ( source ) {
}
}
this.assertions.push({
});
},
if ( !this instanceof Test ) {
throw new Error( "pushFailure() assertion outside test context, was " +
sourceFromStacktrace( 2 ) );
}
var details = {
result: false,
};
if ( source ) {
}
this.assertions.push({
result: false,
});
},
test = this;
if ( promise != null ) {
function( error ) {
message = "Promise rejected " +
// else next test will carry the responsibility
saveGlobal();
// Unblock
}
);
}
}
},
valid: function() {
var include,
// Internally-generated tests are always valid
return true;
}
return false;
}
return false;
}
if ( !filter ) {
return true;
}
if ( !include ) {
}
// If the filter matches, we need to honour include
return include;
}
// Otherwise, do the opposite
return !include;
}
};
// Resets the test setup. Useful for tests that modify the DOM.
/*
DEPRECATED: Use multiple tests instead of resetting inside a test.
Use testStart or testDone for custom cleanup.
This method will throw an error in 2.0, and will be removed in 2.1
*/
// Return on non-browser environments
// This is necessary to not break on node tests
if ( typeof window === "undefined" ) {
return;
}
if ( fixture ) {
}
};
QUnit.pushFailure = function() {
throw new Error( "pushFailure() assertion outside test context, in " +
sourceFromStacktrace( 2 ) );
}
// Gets current test obj
};
// Based on Java's String.hashCode, a simple but not
// rigorously collision resistant hashing function
var hex,
i = 0,
hash = 0,
for ( ; i < len; i++ ) {
hash |= 0;
}
// Convert the possibly negative integer hash code into an 8 character hex string, which isn't
// strictly necessary but increases user understanding that the id is a SHA-like hash
}
}
function Assert( testContext ) {
this.test = testContext;
}
// Assert helpers
// Specify the number of expected assertions to guarantee that failed test
// (no assertions are run at all) don't slip through.
} else {
}
},
// Increment this Test's semaphore counter, then return a single-use function that
// decrements that counter a maximum of once.
async: function() {
popped = false;
return function done() {
if ( !popped ) {
popped = true;
} else {
sourceFromStacktrace( 2 ) );
}
};
},
// Exports test.push() to the user API
push: function( /* result, actual, expected, message */ ) {
var assert = this,
// Backwards compatibility fix.
// Allows the direct use of global exported assertions and QUnit.assert.*
// Although, it's use is not recommended as it can leak assertions
// to other tests from async tests, because we only get a reference to the current test,
// not exactly the test where assertion were intended to be called.
if ( !currentTest ) {
}
sourceFromStacktrace( 2 ) );
// Allow this assertion to continue running anyway...
}
}
},
/**
* Asserts rough true-ish result.
* @name ok
* @function
* @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
*/
},
/**
* Assert that the first two arguments are equal, with an optional message.
* Prints out both actual and expected values.
* @name equal
* @function
* @example equal( format( "{0} bytes.", 2), "2 bytes.", "replaces {0} with next argument" );
*/
/*jshint eqeqeq:false */
},
/**
* @name notEqual
* @function
*/
/*jshint eqeqeq:false */
},
/**
* @name propEqual
* @function
*/
},
/**
* @name notPropEqual
* @function
*/
},
/**
* @name deepEqual
* @function
*/
},
/**
* @name notDeepEqual
* @function
*/
},
/**
* @name strictEqual
* @function
*/
},
/**
* @name notStrictEqual
* @function
*/
},
var actual, expectedType,
ok = false;
// 'expected' is optional unless doing string comparison
expected = null;
}
this.test.ignoreGlobalErrors = true;
try {
} catch (e) {
actual = e;
}
this.test.ignoreGlobalErrors = false;
if ( actual ) {
// we don't want to validate thrown error
if ( !expected ) {
ok = true;
expectedOutput = null;
// expected is a regexp
} else if ( expectedType === "regexp" ) {
// expected is a string
} else if ( expectedType === "string" ) {
// expected is a constructor, maybe an Error constructor
ok = true;
// expected is an Error object
} else if ( expectedType === "object" ) {
// expected is a validation function which returns true if validation passed
expectedOutput = null;
ok = true;
}
} else {
}
}
};
// Provide an alternative to assert.throws(), for enviroments that consider throws a reserved word
// Known to us are: Closure Compiler, Narwhal
(function() {
/*jshint sub:true */
}());
// Test for equality any JavaScript type.
// Author: Philippe Rathé <prathe@gmail.com>
// Call the o related callback with the given arguments.
if ( prop ) {
} else {
}
}
}
// the real equiv function
var innerEquiv,
callers = [],
// stack to avoiding loops from circular referencing
parents = [],
parentsB = [],
/* jshint camelcase: false, proto: true */
},
callbacks = (function() {
// for string, boolean, number and null
function useStrictEquality( b, a ) {
/*jshint eqeqeq:false */
if ( b instanceof a.constructor || a instanceof b.constructor ) {
// to catch short annotation VS 'new' annotation of a
// declaration
// e.g. var i = 1;
// var j = new Number(1);
return a == b;
} else {
return a === b;
}
}
return {
"string": useStrictEquality,
"boolean": useStrictEquality,
"number": useStrictEquality,
"null": useStrictEquality,
"undefined": useStrictEquality,
"nan": function( b ) {
return isNaN( b );
},
"date": function( b, a ) {
},
"regexp": function( b, a ) {
// the regex itself
// and its modifiers
// (gmi) ...
a.ignoreCase === b.ignoreCase &&
},
// - skip when the property is a method of an instance (OOP)
// - abort otherwise,
// initial === would have catch identical references anyway
"function": function() {
},
"array": function( b, a ) {
// b could be an object literal here
return false;
}
// safe and faster
return false;
}
// track reference to avoid circular references
for ( i = 0; i < len; i++ ) {
loop = false;
loop = true;
} else {
return false;
}
}
}
if ( !loop && !innerEquiv( a[ i ], b[ i ] ) ) {
return false;
}
}
return true;
},
"object": function( b, a ) {
/*jshint forin:false */
// Default to true
eq = true,
aProperties = [],
bProperties = [];
// comparing constructors is more strict than using
// instanceof
if ( a.constructor !== b.constructor ) {
// Allow objects with no prototype to be equivalent to
// objects with Object as their constructor.
return false;
}
}
// stack constructor before traversing properties
// track reference to avoid circular references
// be strict: don't ensure hasOwnProperty and go deep
for ( i in a ) {
loop = false;
loop = true;
} else {
eq = false;
break;
}
}
}
aProperties.push( i );
if ( !loop && !innerEquiv( a[ i ], b[ i ] ) ) {
eq = false;
break;
}
}
for ( i in b ) {
}
// Ensures identical properties name
}
};
}());
innerEquiv = function() { // can take multiple arguments
return true; // end transition
}
return ( (function( a, b ) {
if ( a === b ) {
return true; // catch the most you can
} else if ( a === null || b === null || typeof a === "undefined" ||
typeof b === "undefined" ||
// don't lose time with error prone cases
return false;
} else {
return bindCallbacks( a, callbacks, [ b, a ] );
}
// apply transition with (1..n) arguments
};
return innerEquiv;
}());
// Based on jsDump by Ariel Flesler
}
function literal( o ) {
return o + "";
}
}
if ( !arr ) {
}
}
ret = new Array( i );
return "[object Array]";
}
this.up();
while ( i-- ) {
}
this.down();
}
var reName = /^function (\w+)/,
dump = {
// objType is used mostly internally, you can fix a (custom) type in advance
if ( inStack !== -1 ) {
}
parserType = typeof parser;
if ( parserType === "function" ) {
return res;
}
},
var type;
if ( obj === null ) {
type = "null";
} else if ( typeof obj === "undefined" ) {
type = "undefined";
type = "regexp";
type = "date";
type = "function";
type = "window";
type = "document";
type = "node";
} else if (
// native arrays
// NodeList objects
) {
type = "array";
type = "error";
} else {
}
return type;
},
separator: function() {
},
// extra can be a number, shortcut for increasing-calling-decreasing
if ( !this.multiline ) {
return "";
}
var chr = this.indentChar;
if ( this.HTML ) {
}
},
up: function( a ) {
this.depth += a || 1;
},
down: function( a ) {
this.depth -= a || 1;
},
},
// The next 3 are exposed so you can use them
//
depth: 1,
maxDepth: 5,
// This is the list of parsers, to modify them, use dump.setParser
parsers: {
window: "[Window]",
document: "[Document]",
},
unknown: "[Unknown]",
"null": "null",
"undefined": "undefined",
"function": function( fn ) {
var ret = "function",
// functions never have name in IE
if ( name ) {
}
ret += "( ";
},
"arguments": array,
ret = [];
return "[object Object]";
}
keys = [];
}
// Some properties are not always enumerable on Error objects.
for ( i in nonEnumerableProperties ) {
key = nonEnumerableProperties[ i ];
}
}
}
},
if ( attrs ) {
// IE6 includes all attributes in .attributes, even ones not explicitly
// set. Those have values like undefined, null, 0, false, "" or
// "inherit".
}
}
}
// Show content of TextNode or CDATASection
}
},
// function calls it internally, it's the arguments part of the function
functionArgs: function( fn ) {
var args,
if ( !l ) {
return "";
}
args = new Array( l );
while ( l-- ) {
// 97 is 'a'
}
},
// object calls it internally, the key part of an item in a map
// function calls it internally, it's the content of the function
functionCode: "[code]",
// node calls it internally, it's an html attribute value
"boolean": literal
},
// if true, entities are escaped ( <, >, \t, space and \n )
HTML: false,
// indentation unit
indentChar: " ",
// if true, items in a collection, are separated by a \n, else just a space.
multiline: true
};
return dump;
}());
// back compat
// For browser, export only select globals
if ( typeof window !== "undefined" ) {
// Deprecated
// Extend assert methods to QUnit and Global scope through Backwards compatibility
(function() {
var i,
function applyCurrent( current ) {
return function() {
};
}
for ( i in assertions ) {
}
})();
(function() {
var i, l,
keys = [
"test",
"module",
"expect",
"asyncTest",
"start",
"stop",
"ok",
"equal",
"notEqual",
"propEqual",
"notPropEqual",
"deepEqual",
"notDeepEqual",
"strictEqual",
"notStrictEqual",
"throws"
];
}
})();
}
// For nodejs
// For consistency with CommonJS environments' exports
}
// For CommonJS with exports, but without module.exports, like Rhino
}
// Get a reference to the global object, like window in browsers
}( (function() {
return this;
})() ));
/*istanbul ignore next */
// jscs:disable maximumLineLength
/*
* Javascript Diff Algorithm
* By John Resig (http://ejohn.org/)
* Modified by Chu Alan "sprite"
*
* Released under the MIT license.
*
* More Info:
*
* Usage: QUnit.diff(expected, actual)
*
* QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
*/
/*jshint eqeqeq:false, eqnull:true */
function diff( o, n ) {
var i,
ns = {},
os = {};
for ( i = 0; i < n.length; i++ ) {
ns[ n[ i ] ] = {
rows: [],
o: null
};
}
}
for ( i = 0; i < o.length; i++ ) {
os[ o[ i ] ] = {
rows: [],
n: null
};
}
}
for ( i in ns ) {
};
};
}
}
}
if ( n[ i ].text != null && n[ i + 1 ].text == null && n[ i ].row + 1 < o.length && o[ n[ i ].row + 1 ].text == null &&
n[ i + 1 ] = {
text: n[ i + 1 ],
};
o[ n[ i ].row + 1 ] = {
row: i + 1
};
}
}
if ( n[ i ].text != null && n[ i - 1 ].text == null && n[ i ].row > 0 && o[ n[ i ].row - 1 ].text == null &&
n[ i - 1 ] = {
text: n[ i - 1 ],
};
o[ n[ i ].row - 1 ] = {
row: i - 1
};
}
}
return {
o: o,
n: n
};
}
return function( o, n ) {
o = o.replace( /\s+$/, "" );
n = n.replace( /\s+$/, "" );
var i, pre,
str = "",
if ( oSpace == null ) {
oSpace = [ " " ];
} else {
}
if ( nSpace == null ) {
nSpace = [ " " ];
} else {
}
}
} else {
}
}
} else {
// `pre` initialized at top of scope
pre = "";
}
}
}
}
return str;
};
}());
// jscs:enable
(function() {
// Deprecated QUnit.init - Ref #530
// Re-initialize the configuration options
// Return on non-browser environments
// This is necessary to not break on node tests
if ( typeof window === "undefined" ) {
return;
}
if ( qunit ) {
"<h2 id='qunit-banner'></h2>" +
"<div id='qunit-testrunner-toolbar'></div>" +
"<h2 id='qunit-userAgent'></h2>" +
"<ol id='qunit-tests'></ol>";
}
if ( tests ) {
}
if ( banner ) {
}
if ( result ) {
}
if ( tests ) {
}
};
// Don't load the HTML Reporter on non-Browser environments
if ( typeof window === "undefined" ) {
return;
}
defined = {
sessionStorage: (function() {
var x = "qunit-test-string";
try {
sessionStorage.setItem( x, x );
sessionStorage.removeItem( x );
return true;
} catch ( e ) {
return false;
}
}())
},
modulesList = [];
/**
* Escape text for attribute or text content.
*/
function escapeText( s ) {
if ( !s ) {
return "";
}
s = s + "";
// Both single quotes and double quotes (for attributes)
return s.replace( /['"<>&]/g, function( s ) {
switch ( s ) {
case "'":
return "'";
case "\"":
return """;
case "<":
return "<";
case ">":
return ">";
case "&":
return "&";
}
});
}
/**
* @param {HTMLElement} elem
* @param {string} type
* @param {Function} fn
*/
if ( elem.addEventListener ) {
// Standards-based browsers
} else if ( elem.attachEvent ) {
// support: IE <9
}
}
/**
* @param {Array|NodeList} elems
* @param {string} type
* @param {Function} fn
*/
while ( i-- ) {
}
}
}
}
}
} else {
}
}
// Class name may appear multiple times
}
// trim for prettiness
}
}
function getUrlConfigHtml() {
var i, j, val,
selection = false,
urlConfigHtml = "";
for ( i = 0; i < len; i++ ) {
if ( typeof val === "string" ) {
val = {
};
}
}
} else {
": </label><select id='qunit-urlconfig-" + escaped +
}
} else {
}
}
}
}
urlConfigHtml += "</select>";
}
}
return urlConfigHtml;
}
// Handle "click" events on toolbar checkboxes and "change" for select menus.
// Updates the URL with the new state of `config.urlConfig` values.
function toolbarChanged() {
var updatedUrl, value,
field = this,
params = {};
// Detect if field is a select menu or a checkbox
if ( "selectedIndex" in field ) {
} else {
}
if ( value ) {
} else {
}
// It is not necessary to refresh the whole page
} else {
}
}
var key,
querystring = "?";
continue;
}
}
querystring += "&";
}
}
}
function applyUrlParams() {
// Remove testId filter
});
}
function toolbarUrlConfigContainer() {
// For oldIE support:
// * Add handlers to the individual elements instead of the container
// * Use "click" instead of "change" for checkboxes
return urlConfigContainer;
}
function toolbarLooseFilter() {
ev.preventDefault();
}
return false;
});
return filter;
}
function toolbarModuleFilterHtml() {
var i,
moduleFilterHtml = "";
if ( !modulesList.length ) {
return false;
}
modulesList.sort(function( a, b ) {
return a.localeCompare( b );
});
moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label>" +
"<select id='qunit-modulefilter' name='modulefilter'><option value='' " +
">< All Modules ></option>";
moduleFilterHtml += "<option value='" +
}
moduleFilterHtml += "</select>";
return moduleFilterHtml;
}
function toolbarModuleFilter() {
if ( !toolbar || !moduleFilterHtml ) {
return false;
}
}
function appendToolbar() {
if ( toolbar ) {
}
}
function appendHeader() {
if ( header ) {
}
}
function appendBanner() {
if ( banner ) {
}
}
function appendTestResults() {
if ( result ) {
}
if ( tests ) {
}
}
function storeFixture() {
if ( fixture ) {
}
}
function appendUserAgent() {
if ( userAgent ) {
}
}
function appendTestsList( modules ) {
}
}
}
}
if ( !tests ) {
return;
}
}
// HTML Reporter initialization and load
// Fixture is the only one necessary to run without the #qunit element
storeFixture();
if ( qunit ) {
"<h2 id='qunit-banner'></h2>" +
"<div id='qunit-testrunner-toolbar'></div>" +
"<h2 id='qunit-userAgent'></h2>" +
"<ol id='qunit-tests'></ol>";
}
appendHeader();
appendBanner();
}
});
var i, key,
html = [
"Tests completed in ",
" milliseconds.<br />",
"<span class='passed'>",
"</span> assertions of <span class='total'>",
"</span> passed, <span class='failed'>",
"</span> failed."
].join( "" );
if ( banner ) {
}
if ( tests ) {
}
// show ✖ for good, ✔ for bad suite result in title
// use escape sequences in case file gets loaded with non-utf-8-charset
].join( " " );
}
// clear own sessionStorage items if all tests passed
}
}
}
// scroll back to top to show results
}
});
var nameHtml = "";
if ( module ) {
}
return nameHtml;
}
if ( testBlock ) {
} else {
// Report later registered tests
}
if ( running ) {
}
});
var assertList, assertLi,
if ( !testItem ) {
return;
}
// pushFailure doesn't provide details.expected
// when it calls, it's implicit to also not show expected and diff stuff
// Also, we need to check details.expected existence, as it can exist and be undefined
message += "<table><tr class='test-expected'><th>Expected: </th><td><pre>" +
expected +
"</pre></td></tr>";
message += "<tr class='test-actual'><th>Result: </th><td><pre>" +
actual + "</pre></td></tr>" +
"<tr class='test-diff'><th>Diff: </th><td><pre>" +
}
message += "<tr class='test-source'><th>Source: </th><td><pre>" +
}
message += "</table>";
// this occours when pushFailure is set and we have an extracted stack trace
message += "<table>" +
"<tr class='test-source'><th>Source: </th><td><pre>" +
"</table>";
}
});
if ( !tests ) {
return;
}
// store result when possible
if ( bad ) {
} else {
}
}
if ( bad === 0 ) {
}
// testItem.firstChild is the test name
testCounts = bad ?
"";
} else {
});
}
});
config.pageLoaded = true;
}
}
})();