diff --git a/vendor/qunit/qunit/qunit.css b/vendor/qunit/qunit/qunit.css
index d7fc0c8ec..55970e006 100644
--- a/vendor/qunit/qunit/qunit.css
+++ b/vendor/qunit/qunit/qunit.css
@@ -1,5 +1,5 @@
/**
- * QUnit v1.11.0 - A JavaScript Unit Testing Framework
+ * QUnit v1.10.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
@@ -20,7 +20,7 @@
/** Resets */
-#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
+#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
@@ -111,12 +111,7 @@
color: #000;
}
-#qunit-tests li .runtime {
- float: right;
- font-size: smaller;
-}
-
-.qunit-assert-list {
+#qunit-tests ol {
margin-top: 0.5em;
padding: 0.5em;
@@ -127,10 +122,6 @@
-webkit-border-radius: 5px;
}
-.qunit-collapsed {
- display: none;
-}
-
#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
diff --git a/vendor/qunit/qunit/qunit.js b/vendor/qunit/qunit/qunit.js
index 302545f40..d4f17b5ae 100644
--- a/vendor/qunit/qunit/qunit.js
+++ b/vendor/qunit/qunit/qunit.js
@@ -1,5 +1,5 @@
/**
- * QUnit v1.11.0 - A JavaScript Unit Testing Framework
+ * QUnit v1.10.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
@@ -11,7 +11,6 @@
(function( window ) {
var QUnit,
- assert,
config,
onErrorFnPrev,
testId = 0,
@@ -21,67 +20,18 @@ var QUnit,
// Keep a local reference to Date (GH-283)
Date = window.Date,
defined = {
- setTimeout: typeof window.setTimeout !== "undefined",
- 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 ) {
- var name, message,
- errorString = error.toString();
- if ( errorString.substring( 0, 7 ) === "[object" ) {
- name = error.name ? error.name.toString() : "Error";
- message = error.message ? error.message.toString() : "";
- if ( name && message ) {
- return name + ": " + message;
- } else if ( name ) {
- return name;
- } else if ( message ) {
- return message;
- } else {
- return "Error";
- }
- } else {
- return errorString;
+ setTimeout: typeof window.setTimeout !== "undefined",
+ sessionStorage: (function() {
+ var x = "qunit-test-string";
+ try {
+ sessionStorage.setItem( x, x );
+ sessionStorage.removeItem( x );
+ return true;
+ } catch( e ) {
+ return false;
}
- },
- /**
- * 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 ) {
- // Grunt 0.3.x uses an older version of jshint that still has jshint/jshint#392.
- /*jshint newcap: false */
- var key, val,
- vals = QUnit.is( "array", obj ) ? [] : {};
- for ( key in obj ) {
- if ( hasOwn.call( obj, key ) ) {
- val = obj[key];
- vals[key] = val === Object(val) ? objectValues(val) : val;
- }
- }
- return vals;
- };
+ }())
+};
function Test( settings ) {
extend( this, settings );
@@ -94,11 +44,11 @@ Test.count = 0;
Test.prototype = {
init: function() {
var a, b, li,
- tests = id( "qunit-tests" );
+ tests = id( "qunit-tests" );
if ( tests ) {
b = document.createElement( "strong" );
- b.innerHTML = this.nameHtml;
+ b.innerHTML = this.name;
// `a` initialized at top of scope
a = document.createElement( "a" );
@@ -142,7 +92,6 @@ Test.prototype = {
teardown: function() {}
}, this.moduleTestEnvironment );
- this.started = +new Date();
runLoggingCallbacks( "testStart", QUnit, {
name: this.testName,
module: this.module
@@ -162,7 +111,7 @@ Test.prototype = {
try {
this.testEnvironment.setup.call( this.testEnvironment );
} catch( e ) {
- QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) );
+ QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
}
},
run: function() {
@@ -171,28 +120,22 @@ Test.prototype = {
var running = id( "qunit-testresult" );
if ( running ) {
- running.innerHTML = "Running:
" + this.nameHtml;
+ running.innerHTML = "Running:
" + this.name;
}
if ( this.async ) {
QUnit.stop();
}
- this.callbackStarted = +new Date();
-
if ( config.notrycatch ) {
this.callback.call( this.testEnvironment, QUnit.assert );
- this.callbackRuntime = +new Date() - this.callbackStarted;
return;
}
try {
this.callback.call( this.testEnvironment, QUnit.assert );
- this.callbackRuntime = +new Date() - this.callbackStarted;
} catch( e ) {
- this.callbackRuntime = +new Date() - this.callbackStarted;
-
- QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) );
+ QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + e.message, extractStacktrace( e, 0 ) );
// else next test will carry the responsibility
saveGlobal();
@@ -205,43 +148,38 @@ Test.prototype = {
teardown: function() {
config.current = this;
if ( config.notrycatch ) {
- if ( typeof this.callbackRuntime === "undefined" ) {
- this.callbackRuntime = +new Date() - this.callbackStarted;
- }
this.testEnvironment.teardown.call( this.testEnvironment );
return;
} else {
try {
this.testEnvironment.teardown.call( this.testEnvironment );
} catch( e ) {
- QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) );
+ QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
}
}
checkPollution();
},
finish: function() {
config.current = this;
- if ( config.requireExpects && this.expected === null ) {
+ if ( config.requireExpects && this.expected == null ) {
QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack );
- } else if ( this.expected !== null && this.expected !== this.assertions.length ) {
+ } else if ( this.expected != null && this.expected != this.assertions.length ) {
QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack );
- } else if ( this.expected === null && !this.assertions.length ) {
+ } else if ( this.expected == null && !this.assertions.length ) {
QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack );
}
- var i, assertion, a, b, time, li, ol,
+ var assertion, a, b, i, li, ol,
test = this,
good = 0,
bad = 0,
tests = id( "qunit-tests" );
- this.runtime = +new Date() - this.started;
config.stats.all += this.assertions.length;
config.moduleStats.all += this.assertions.length;
if ( tests ) {
ol = document.createElement( "ol" );
- ol.className = "qunit-assert-list";
for ( i = 0; i < this.assertions.length; i++ ) {
assertion = this.assertions[i];
@@ -270,22 +208,22 @@ Test.prototype = {
}
if ( bad === 0 ) {
- addClass( ol, "qunit-collapsed" );
+ ol.style.display = "none";
}
// `b` initialized at top of scope
b = document.createElement( "strong" );
- b.innerHTML = this.nameHtml + " (" + bad + ", " + good + ", " + this.assertions.length + ")";
+ b.innerHTML = this.name + " (" + bad + ", " + good + ", " + this.assertions.length + ")";
addEvent(b, "click", function() {
- var next = b.parentNode.lastChild,
- collapsed = hasClass( next, "qunit-collapsed" );
- ( collapsed ? removeClass : addClass )( next, "qunit-collapsed" );
+ var next = b.nextSibling.nextSibling,
+ display = next.style.display;
+ next.style.display = display === "none" ? "block" : "none";
});
addEvent(b, "dblclick", function( e ) {
var target = e && e.target ? e.target : window.event.srcElement;
- if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) {
+ if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
target = target.parentNode;
}
if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
@@ -293,19 +231,13 @@ Test.prototype = {
}
});
- // `time` initialized at top of scope
- time = document.createElement( "span" );
- time.className = "runtime";
- time.innerHTML = this.runtime + " ms";
-
// `li` initialized at top of scope
li = id( this.id );
li.className = bad ? "fail" : "pass";
li.removeChild( li.firstChild );
a = li.firstChild;
li.appendChild( b );
- li.appendChild( a );
- li.appendChild( time );
+ li.appendChild ( a );
li.appendChild( ol );
} else {
@@ -323,8 +255,7 @@ Test.prototype = {
module: this.module,
failed: bad,
passed: this.assertions.length - bad,
- total: this.assertions.length,
- duration: this.runtime
+ total: this.assertions.length
});
QUnit.reset();
@@ -390,7 +321,7 @@ QUnit = {
test: function( testName, expected, callback, async ) {
var test,
- nameHtml = "" + escapeText( testName ) + "";
+ name = "" + escapeInnerText( testName ) + "";
if ( arguments.length === 2 ) {
callback = expected;
@@ -398,11 +329,11 @@ QUnit = {
}
if ( config.currentModule ) {
- nameHtml = "" + escapeText( config.currentModule ) + ": " + nameHtml;
+ name = "" + config.currentModule + ": " + name;
}
test = new Test({
- nameHtml: nameHtml,
+ name: name,
testName: testName,
expected: expected,
async: async,
@@ -429,18 +360,6 @@ QUnit = {
},
start: function( count ) {
- // QUnit hasn't been initialized yet.
- // Note: RequireJS (et al) may delay onLoad
- if ( config.semaphore === undefined ) {
- QUnit.begin(function() {
- // This is triggered at the top of QUnit.load, push start() to the event loop, to allow QUnit.load to finish first
- setTimeout(function() {
- QUnit.start( count );
- });
- });
- return;
- }
-
config.semaphore -= count || 1;
// don't start until equal number of stop-calls
if ( config.semaphore > 0 ) {
@@ -449,8 +368,6 @@ QUnit = {
// ignore if start is called more often then stop
if ( config.semaphore < 0 ) {
config.semaphore = 0;
- QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) );
- return;
}
// A slight delay, to avoid any current callbacks
if ( defined.setTimeout ) {
@@ -486,14 +403,11 @@ QUnit = {
}
};
-// `assert` initialized at top of scope
// Asssert helpers
-// All of these must either call QUnit.push() or manually do:
+// All of these must call either QUnit.push() or manually do:
// - runLoggingCallbacks( "log", .. );
// - config.current.assertions.push({ .. });
-// We attach it to the QUnit object *after* we expose the public API,
-// otherwise `assert` will become a global variable in browsers (#341).
-assert = {
+QUnit.assert = {
/**
* Asserts rough true-ish result.
* @name ok
@@ -514,14 +428,14 @@ assert = {
message: msg
};
- msg = escapeText( msg || (result ? "okay" : "failed" ) );
+ msg = escapeInnerText( msg || (result ? "okay" : "failed" ) );
msg = "" + msg + "";
if ( !result ) {
source = sourceFromStacktrace( 2 );
if ( source ) {
details.source = source;
- msg += "
| Source: | " + escapeText( source ) + " |
|---|
";
+ msg += "| Source: | " + escapeInnerText( source ) + " |
|---|
";
}
}
runLoggingCallbacks( "log", QUnit, details );
@@ -539,7 +453,6 @@ assert = {
* @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" );
*/
equal: function( actual, expected, message ) {
- /*jshint eqeqeq:false */
QUnit.push( expected == actual, actual, expected, message );
},
@@ -548,30 +461,9 @@ assert = {
* @function
*/
notEqual: function( actual, expected, message ) {
- /*jshint eqeqeq:false */
QUnit.push( expected != actual, actual, expected, message );
},
- /**
- * @name propEqual
- * @function
- */
- propEqual: function( actual, expected, message ) {
- actual = objectValues(actual);
- expected = objectValues(expected);
- QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
- },
-
- /**
- * @name notPropEqual
- * @function
- */
- notPropEqual: function( actual, expected, message ) {
- actual = objectValues(actual);
- expected = objectValues(expected);
- QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message );
- },
-
/**
* @name deepEqual
* @function
@@ -604,9 +496,8 @@ assert = {
QUnit.push( expected !== actual, actual, expected, message );
},
- "throws": function( block, expected, message ) {
+ throws: function( block, expected, message ) {
var actual,
- expectedOutput = expected,
ok = false;
// 'expected' is optional
@@ -627,20 +518,18 @@ assert = {
// we don't want to validate thrown error
if ( !expected ) {
ok = true;
- expectedOutput = null;
// expected is a regexp
} else if ( QUnit.objectType( expected ) === "regexp" ) {
- ok = expected.test( errorString( actual ) );
+ ok = expected.test( actual );
// expected is a constructor
} else if ( actual instanceof expected ) {
ok = true;
// expected is a validation function which returns true is validation passed
} else if ( expected.call( {}, actual ) === true ) {
- expectedOutput = null;
ok = true;
}
- QUnit.push( ok, actual, expectedOutput, message );
+ QUnit.push( ok, actual, null, message );
} else {
QUnit.pushFailure( message, null, 'No exception was thrown.' );
}
@@ -649,16 +538,15 @@ assert = {
/**
* @deprecate since 1.8.0
- * Kept assertion helpers in root for backwards compatibility.
+ * Kept assertion helpers in root for backwards compatibility
*/
-extend( QUnit, assert );
+extend( QUnit, QUnit.assert );
/**
* @deprecated since 1.9.0
- * Kept root "raises()" for backwards compatibility.
- * (Note that we don't introduce assert.raises).
+ * Kept global "raises()" for backwards compatibility
*/
-QUnit.raises = assert[ "throws" ];
+QUnit.raises = QUnit.assert.throws;
/**
* @deprecated since 1.0.0, replaced with error pushes since 1.3.0
@@ -734,15 +622,6 @@ config = {
moduleDone: []
};
-// Export global variables, unless an 'exports' object exists,
-// in that case we assume we're in CommonJS (dealt with on the bottom of the script)
-if ( typeof exports === "undefined" ) {
- extend( window, QUnit );
-
- // Expose QUnit object
- window.QUnit = QUnit;
-}
-
// Initialize more QUnit.config and QUnit.urlParams
(function() {
var i,
@@ -776,11 +655,18 @@ if ( typeof exports === "undefined" ) {
QUnit.isLocal = location.protocol === "file:";
}());
+// Export global variables, unless an 'exports' object exists,
+// in that case we assume we're in CommonJS (dealt with on the bottom of the script)
+if ( typeof exports === "undefined" ) {
+ extend( window, QUnit );
+
+ // Expose QUnit object
+ window.QUnit = QUnit;
+}
+
// Extend QUnit object,
// these after set here because they should not be exposed as global functions
extend( QUnit, {
- assert: assert,
-
config: config,
// Initialize the configuration options
@@ -795,7 +681,7 @@ extend( QUnit, {
autorun: false,
filter: "",
queue: [],
- semaphore: 1
+ semaphore: 0
});
var tests, banner, result,
@@ -803,7 +689,7 @@ extend( QUnit, {
if ( qunit ) {
qunit.innerHTML =
- "" +
+ "" +
"" +
"" +
"" +
@@ -859,7 +745,7 @@ extend( QUnit, {
// Safe object type checking
is: function( type, obj ) {
- return QUnit.objectType( obj ) === type;
+ return QUnit.objectType( obj ) == type;
},
objectType: function( obj ) {
@@ -871,8 +757,7 @@ extend( QUnit, {
return "null";
}
- var match = toString.call( obj ).match(/^\[object\s(.*)\]$/),
- type = match && match[1] || "";
+ var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || "";
switch ( type ) {
case "Number":
@@ -909,16 +794,16 @@ extend( QUnit, {
expected: expected
};
- message = escapeText( message ) || ( result ? "okay" : "failed" );
+ message = escapeInnerText( message ) || ( result ? "okay" : "failed" );
message = "" + message + "";
output = message;
if ( !result ) {
- expected = escapeText( QUnit.jsDump.parse(expected) );
- actual = escapeText( QUnit.jsDump.parse(actual) );
+ expected = escapeInnerText( QUnit.jsDump.parse(expected) );
+ actual = escapeInnerText( QUnit.jsDump.parse(actual) );
output += "| Expected: | " + expected + " |
";
- if ( actual !== expected ) {
+ if ( actual != expected ) {
output += "| Result: | " + actual + " |
";
output += "| Diff: | " + QUnit.diff( expected, actual ) + " |
";
}
@@ -927,7 +812,7 @@ extend( QUnit, {
if ( source ) {
details.source = source;
- output += "| Source: | " + escapeText( source ) + " |
";
+ output += "| Source: | " + escapeInnerText( source ) + " |
";
}
output += "
";
@@ -954,19 +839,19 @@ extend( QUnit, {
message: message
};
- message = escapeText( message ) || "error";
+ message = escapeInnerText( message ) || "error";
message = "" + message + "";
output = message;
output += "";
if ( actual ) {
- output += "| Result: | " + escapeText( actual ) + " |
";
+ output += "| Result: | " + escapeInnerText( actual ) + " |
";
}
if ( source ) {
details.source = source;
- output += "| Source: | " + escapeText( source ) + " |
";
+ output += "| Source: | " + escapeInnerText( source ) + " |
";
}
output += "
";
@@ -991,8 +876,7 @@ extend( QUnit, {
querystring += encodeURIComponent( key ) + "=" +
encodeURIComponent( params[ key ] ) + "&";
}
- return window.location.protocol + "//" + window.location.host +
- window.location.pathname + querystring.slice( 0, -1 );
+ return window.location.pathname + querystring.slice( 0, -1 );
},
extend: extend,
@@ -1023,7 +907,7 @@ extend( QUnit.constructor.prototype, {
// testStart: { name }
testStart: registerLoggingCallback( "testStart" ),
- // testDone: { name, failed, passed, total, duration }
+ // testDone: { name, failed, passed, total }
testDone: registerLoggingCallback( "testDone" ),
// moduleStart: { name }
@@ -1041,10 +925,9 @@ QUnit.load = function() {
runLoggingCallbacks( "begin", QUnit, {} );
// Initialize the config, saving the execution queue
- var banner, filter, i, label, len, main, ol, toolbar, userAgent, val,
- urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter,
- numModules = 0,
- moduleFilterHtml = "",
+ var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, moduleFilter,
+ numModules = 0,
+ moduleFilterHtml = "",
urlConfigHtml = "",
oldconfig = extend( {}, config );
@@ -1065,24 +948,14 @@ QUnit.load = function() {
};
}
config[ val.id ] = QUnit.urlParams[ val.id ];
- urlConfigHtml += "";
+ urlConfigHtml += "";
}
- moduleFilterHtml += "