Upstream:
* git-repo: https://github.com/jquery/qunit.git
* git-tag: v1.10.0
* git-commit:
900f72051b0112342feda3d700a7a049d886b9ce
* tree:
https://github.com/jquery/qunit/tree/v1.10.0
* compare:
https://github.com/jquery/qunit/compare/v1.9.0...v1.10.0
* release-notes:
https://github.com/jquery/qunit/blob/v1.10.0/History.md
Change-Id: If8529952a1d9f228ad1c5697057afea12fdf3630
* Edit notices can now be translated.
* jQuery upgraded to 1.8.1
* jQuery UI upgraded to 1.8.23.
* Edit notices can now be translated.
* jQuery upgraded to 1.8.1
* jQuery UI upgraded to 1.8.23.
-* (bug 35705) QUnit upgraded from v1.2.0 to v1.9.0.
+* QUnit upgraded from v1.2.0 to v1.10.0.
* (bug 37604) jquery.cookie upgraded to 2011 version.
* (bug 22887) Add warning and tracking category for preprocessor errors
* (bug 31704) Allow selection of associated namespace on the watchlist
* (bug 37604) jquery.cookie upgraded to 2011 version.
* (bug 22887) Add warning and tracking category for preprocessor errors
* (bug 31704) Allow selection of associated namespace on the watchlist
- * QUnit v1.9.0 - A JavaScript Unit Testing Framework
+ * QUnit v1.10.0 - A JavaScript Unit Testing Framework
- * http://docs.jquery.com/QUnit
- * Copyright (c) 2012 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * or GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
*/
/** Font Family and Sizes */
*/
/** Font Family and Sizes */
-#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
+#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
+#qunit-modulefilter-container {
+ float: right;
+}
- * QUnit v1.9.0 - A JavaScript Unit Testing Framework
+ * QUnit v1.10.0 - A JavaScript Unit Testing Framework
- * http://docs.jquery.com/QUnit
- * Copyright (c) 2012 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * or GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""),
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""),
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
+ // Keep a local reference to Date (GH-283)
+ Date = window.Date,
defined = {
setTimeout: typeof window.setTimeout !== "undefined",
sessionStorage: (function() {
defined = {
setTimeout: typeof window.setTimeout !== "undefined",
sessionStorage: (function() {
// call on start of module test to prepend name to all tests
module: function( name, testEnvironment ) {
config.currentModule = name;
// call on start of module test to prepend name to all tests
module: function( name, testEnvironment ) {
config.currentModule = name;
- config.currentModuleTestEnviroment = testEnvironment;
+ config.currentModuleTestEnvironment = testEnvironment;
+ config.modules[name] = true;
},
asyncTest: function( testName, expected, callback ) {
},
asyncTest: function( testName, expected, callback ) {
async: async,
callback: callback,
module: config.currentModule,
async: async,
callback: callback,
module: config.currentModule,
- moduleTestEnvironment: config.currentModuleTestEnviroment,
+ moduleTestEnvironment: config.currentModuleTestEnvironment,
stack: sourceFromStacktrace( 2 )
});
stack: sourceFromStacktrace( 2 )
});
// Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
expect: function( asserts ) {
// Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
expect: function( asserts ) {
- config.current.expected = asserts;
+ if (arguments.length === 1) {
+ config.current.expected = asserts;
+ } else {
+ return config.current.expected;
+ }
},
start: function( count ) {
},
start: function( count ) {
+ module: config.current.module,
+ name: config.current.testName,
result: result,
message: msg
};
result: result,
message: msg
};
+ // Set of all modules.
+ modules: {},
+
// logging callback queues
begin: [],
done: [],
// logging callback queues
begin: [],
done: [],
},
// Resets the test setup. Useful for tests that modify the DOM.
},
// Resets the test setup. Useful for tests that modify the DOM.
- // If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
- var fixture;
-
- if ( window.jQuery ) {
- jQuery( "#qunit-fixture" ).html( config.fixture );
- } else {
- fixture = id( "qunit-fixture" );
- if ( fixture ) {
- fixture.innerHTML = config.fixture;
- }
+ var fixture = id( "qunit-fixture" );
+ if ( fixture ) {
+ fixture.innerHTML = config.fixture;
var output, source,
details = {
var output, source,
details = {
+ module: config.current.module,
+ name: config.current.testName,
result: result,
message: message,
actual: actual,
result: result,
message: message,
actual: actual,
+ module: config.current.module,
+ name: config.current.testName,
result: false,
message: message
};
result: false,
message: message
};
runLoggingCallbacks( "begin", QUnit, {} );
// Initialize the config, saving the execution queue
runLoggingCallbacks( "begin", QUnit, {} );
// Initialize the config, saving the execution queue
- var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes,
+ var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, moduleFilter,
+ numModules = 0,
+ moduleFilterHtml = "",
urlConfigHtml = "",
oldconfig = extend( {}, config );
urlConfigHtml = "",
oldconfig = extend( {}, config );
urlConfigHtml += "<input id='qunit-urlconfig-" + val.id + "' name='" + val.id + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + " title='" + val.tooltip + "'><label for='qunit-urlconfig-" + val.id + "' title='" + val.tooltip + "'>" + val.label + "</label>";
}
urlConfigHtml += "<input id='qunit-urlconfig-" + val.id + "' name='" + val.id + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + " title='" + val.tooltip + "'><label for='qunit-urlconfig-" + val.id + "' title='" + val.tooltip + "'>" + val.label + "</label>";
}
+ moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label><select id='qunit-modulefilter' name='modulefilter'><option value='' " + ( config.module === undefined ? "selected" : "" ) + ">< All Modules ></option>";
+ for ( i in config.modules ) {
+ if ( config.modules.hasOwnProperty( i ) ) {
+ numModules += 1;
+ moduleFilterHtml += "<option value='" + encodeURIComponent(i) + "' " + ( config.module === i ? "selected" : "" ) + ">" + i + "</option>";
+ }
+ }
+ moduleFilterHtml += "</select>";
+
// `userAgent` initialized at top of scope
userAgent = id( "qunit-userAgent" );
if ( userAgent ) {
// `userAgent` initialized at top of scope
userAgent = id( "qunit-userAgent" );
if ( userAgent ) {
window.location = QUnit.url( params );
});
toolbar.appendChild( urlConfigCheckboxes );
window.location = QUnit.url( params );
});
toolbar.appendChild( urlConfigCheckboxes );
+
+ if (numModules > 1) {
+ moduleFilter = document.createElement( 'span' );
+ moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' );
+ moduleFilter.innerHTML = moduleFilterHtml;
+ addEvent( moduleFilter, "change", function() {
+ var selectBox = moduleFilter.getElementsByTagName("select")[0],
+ selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value);
+
+ window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } );
+ });
+ toolbar.appendChild(moduleFilter);
+ }
}
// `main` initialized at top of scope
}
// `main` initialized at top of scope
}
QUnit.pushFailure( error, filePath + ":" + linerNr );
} else {
}
QUnit.pushFailure( error, filePath + ":" + linerNr );
} else {
- QUnit.test( "global failure", function() {
+ QUnit.test( "global failure", extend( function() {
QUnit.pushFailure( error, filePath + ":" + linerNr );
QUnit.pushFailure( error, filePath + ":" + linerNr );
+ }, { validTest: validTest } ) );
+ // scroll back to top to show results
+ if ( window.scrollTo ) {
+ window.scrollTo(0, 0);
+ }
+
runLoggingCallbacks( "done", QUnit, {
failed: config.stats.bad,
passed: passed,
runLoggingCallbacks( "done", QUnit, {
failed: config.stats.bad,
passed: passed,
module = config.module && config.module.toLowerCase(),
fullName = (test.module + ": " + test.testName).toLowerCase();
module = config.module && config.module.toLowerCase(),
fullName = (test.module + ": " + test.testName).toLowerCase();
+ // Internally-generated tests are always valid
+ if ( test.callback && test.callback.validTest === validTest ) {
+ delete test.callback.validTest;
+ return true;
+ }
+
if ( config.testNumber ) {
return test.testNumber === config.testNumber;
}
if ( config.testNumber ) {
return test.testNumber === config.testNumber;
}
a.global === b.global &&
// (gmi) ...
a.ignoreCase === b.ignoreCase &&
a.global === b.global &&
// (gmi) ...
a.ignoreCase === b.ignoreCase &&
- a.multiline === b.multiline;
+ a.multiline === b.multiline &&
+ a.sticky === b.sticky;
},
// - skip when the property is a method of an instance (OOP)
},
// - skip when the property is a method of an instance (OOP)