dom/tests/mochitest/ajax/offline/updatingImplicit.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/ajax/offline/updatingImplicit.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/updatingManifest.sjs">
     1.5 +<head>
     1.6 +<title>Updating implicit</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 +
    1.11 +<script type="text/javascript">
    1.12 +
    1.13 +function manifestUpdated()
    1.14 +{
    1.15 +  // Assert that we are properly associated with the application
    1.16 +  // cache.
    1.17 +  var req = new XMLHttpRequest;
    1.18 +  req.open("GET", "namespace2/script3.js", false);
    1.19 +  try {
    1.20 +    req.send(null);
    1.21 +    window.opener.OfflineTest.ok(false, "Able to fetch unlisted resource, not properly associated.");
    1.22 +  } catch(ex) {
    1.23 +    window.opener.OfflineTest.ok(true, "Unable to fetch unlisted resource, properly associated.");
    1.24 +  }
    1.25 +
    1.26 +  req = new XMLHttpRequest;
    1.27 +  req.open("GET", "updatingImplicit.html", false);
    1.28 +  try {
    1.29 +    req.send(null);
    1.30 +    window.opener.OfflineTest.ok(true, "Able to fetch listed resource, properly associated.");
    1.31 +  } catch(ex) {
    1.32 +    window.opener.OfflineTest.ok(false, "Unable to fetch listed resource, not properly associated.");
    1.33 +  }
    1.34 +
    1.35 +  window.opener.implicitLoaded(window, false);
    1.36 +}
    1.37 +
    1.38 +function manifestError()
    1.39 +{
    1.40 +  window.opener.implicitLoaded(window, true);
    1.41 +}
    1.42 +
    1.43 +if (OfflineTest.setupChild()) {
    1.44 +  applicationCache.onerror = OfflineTest.priv(manifestError);
    1.45 +  applicationCache.onupdateready = OfflineTest.failEvent;
    1.46 +  applicationCache.oncached = OfflineTest.failEvent;
    1.47 +  applicationCache.onnoupdate = OfflineTest.priv(manifestUpdated);
    1.48 +}
    1.49 +
    1.50 +</script>
    1.51 +
    1.52 +</head>
    1.53 +
    1.54 +<body>
    1.55 +</body>
    1.56 +</html>

mercurial