1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/ajax/offline/bypass.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml" manifest="bypass.cacheManifest"> 1.5 +<head> 1.6 + 1.7 +<script type="text/javascript" src="namespace1/script.js"></script> 1.8 +<script type="text/javascript" src="namespace1/sub/script1.js"></script> 1.9 +<script type="text/javascript" src="namespace1/sub2/script2.js"></script> 1.10 +<script type="text/javascript" src="namespace2/script3.js"></script> 1.11 + 1.12 +<script class="testbody" type="text/javascript"> 1.13 + 1.14 +function testScriptPresence(scriptPath, func, shouldPass) 1.15 +{ 1.16 + var msg = "Script " + scriptPath + (shouldPass ? " loaded" : " not loaded"); 1.17 + try { 1.18 + eval(func); 1.19 + opener.OfflineTest.ok(shouldPass, msg); 1.20 + } 1.21 + catch(ex) { 1.22 + opener.OfflineTest.ok(!shouldPass, msg); 1.23 + } 1.24 + 1.25 +} 1.26 + 1.27 +function startTest() 1.28 +{ 1.29 + testScriptPresence("namespace1/script.js", "scriptNo0Function();", false); 1.30 + testScriptPresence("namespace1/sub/script1.js", "scriptNo1Function();", true); 1.31 + testScriptPresence("namespace1/sub2/script2.js", "scriptNo2Function();", true); 1.32 + testScriptPresence("namespace2/script3.js", "scriptNo3Function();", true); 1.33 + 1.34 + opener.OfflineTest.teardownAndFinish(); 1.35 + window.close(window); 1.36 +} 1.37 + 1.38 +</script> 1.39 + 1.40 +</head> 1.41 + 1.42 +<body onload="startTest();"> 1.43 +</body> 1.44 +</html>