summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/offline-access.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/resources/offline-access.js')
-rw-r--r--LayoutTests/http/tests/appcache/resources/offline-access.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/resources/offline-access.js b/LayoutTests/http/tests/appcache/resources/offline-access.js
new file mode 100644
index 0000000..a69d73e
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/offline-access.js
@@ -0,0 +1,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);
+ }
+}