Use window.QUnit to detect the top window when loading with AMD

This commit is contained in:
Timmy Willison 2013-08-27 00:31:14 -04:00
parent 01d5a1a1c9
commit ca1c90e55c

4
test/jquery.js vendored
View File

@ -26,7 +26,9 @@
label: "Load with AMD",
tooltip: "Load the AMD jQuery file (and its dependencies)"
});
if ( QUnit.urlParams.amd && parent == window ) {
// If QUnit is on window, this is the main window
// This detection allows AMD tests to be run in an iframe
if ( QUnit.urlParams.amd && window.QUnit ) {
require.config({ baseUrl: src });
src = "src/jquery";
// Include tests if specified