1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/ajax/offline/test_bug544462.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/wildcardManifest.cacheManifest"> 1.5 +<head> 1.6 +<title>wildcard in network section test</title> 1.7 + 1.8 +<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.9 +<script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script> 1.10 +<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.11 + 1.12 +<style> 1.13 + img { 1.14 + max-width: 400px; 1.15 + max-height: 400px; 1.16 + } 1.17 +</style> 1.18 + 1.19 +<script type="text/javascript"> 1.20 + 1.21 +var gImageLoaded = []; 1.22 + 1.23 +function imageOnLoad(idx) 1.24 +{ 1.25 + gImageLoaded[idx] = true; 1.26 +} 1.27 + 1.28 +function manifestUpdated() 1.29 +{ 1.30 + window.location.reload(); 1.31 +} 1.32 + 1.33 +function finishTheTest() 1.34 +{ 1.35 + OfflineTest.is(gImageLoaded[1], true, "Image from a different origin not cointained in the offline cache has loaded"); 1.36 + OfflineTest.is(gImageLoaded[2], true, "Image not cointained in the offline cache has loaded"); 1.37 + OfflineTest.teardownAndFinish(); 1.38 +} 1.39 + 1.40 +if (OfflineTest.setup()) { 1.41 + applicationCache.onerror = OfflineTest.failEvent; 1.42 + applicationCache.oncached = OfflineTest.priv(manifestUpdated); 1.43 + applicationCache.onnoupdate = OfflineTest.priv(finishTheTest); 1.44 +} 1.45 + 1.46 +SimpleTest.waitForExplicitFinish(); 1.47 + 1.48 +</script> 1.49 + 1.50 +</head> 1.51 + 1.52 +<body> 1.53 + <img src="http://example.com/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg" onload="imageOnLoad(1)" /> 1.54 + <img src="jupiter.jpg" onload="imageOnLoad(2)" /> 1.55 +</body> 1.56 +</html>