diff --git a/test/asset/test-ui.js b/test/asset/test-ui.js index c4f038b5d..5456fd2ee 100644 --- a/test/asset/test-ui.js +++ b/test/asset/test-ui.js @@ -128,6 +128,15 @@ init(); }); + // used to indicate testing a foreign file + ui.isForeign = RegExp('^(\\w+:)?//').test(build); + + // used to indicate testing a modularized build + ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search]); + + // used to indicate testing in Sauce Labs' automated test cloud + ui.isSauceLabs = location.port == '9001'; + // expose Lo-Dash build file path ui.buildPath = (function() { var result; @@ -170,12 +179,6 @@ 'loadEventEnd': 0 }; - // used to indicate testing a modularized build - ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search, ui.buildPath]); - - // used to indicate testing in Sauce Labs' automated test cloud - ui.isSauceLabs = location.port == '9001'; - // expose `ui` window.ui = ui; diff --git a/test/asset/worker.js b/test/asset/worker.js index 75f21c9a5..d925de523 100644 --- a/test/asset/worker.js +++ b/test/asset/worker.js @@ -1,6 +1,10 @@ addEventListener('message', function(e) { if (e.data) { - importScripts('../' + e.data); + try { + importScripts('../' + e.data); + } catch(e) { + self._ = {}; + } postMessage(_.VERSION); } }, false); diff --git a/test/index.html b/test/index.html index 9606cf2a8..96a59fc92 100644 --- a/test/index.html +++ b/test/index.html @@ -168,7 +168,7 @@ removeBizarroMethods(); } // load test scripts - document.write(ui.urlParams.loader == 'none' + document.write((ui.isForeign || ui.urlParams.loader == 'none') ? '