summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/offline-access.js
blob: a69d73e5680becd5d2ed9b0ba740e52a3bc9b61b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function test()
{
    applicationCache.oncached = function() { log("cached") }
    applicationCache.onnoupdate = function() { log("noupdate") }
    applicationCache.onerror = function() { log("error") }

    try {
        var req = new XMLHttpRequest;
        req.open("GET", "/resources/network-simulator.php?path=/appcache/resources/simple.txt", false);
        req.send(null);
        if (req.responseText == "Hello, World!")
            parent.postMessage("done", "*");
        else
            alert("FAIL, unexpected response: " + ex);
    } catch (ex) {
        alert("FAIL, unexpected error: " + ex);
    }
}