summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/disabled.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/disabled.html')
-rw-r--r--LayoutTests/http/tests/appcache/disabled.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/disabled.html b/LayoutTests/http/tests/appcache/disabled.html
new file mode 100644
index 0000000..e89752a
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/disabled.html
@@ -0,0 +1,51 @@
+<html>
+<body>
+<p>Test to ensure the the window.applicationCache attribute is defined but non-functional with the feature disabled.</p>
+<div id=result></div>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.overridePreference("WebKitOfflineWebApplicationCacheEnabled", false);
+ layoutTestController.dumpAsText();
+ }
+
+ function log(message)
+ {
+ document.getElementById("result").innerHTML += message + "<br>";
+ }
+
+ function isDefined() {
+ if (window.applicationCache)
+ return true;
+ else
+ return false;
+ }
+
+ function statusIsUncached() {
+ return applicationCache.status == 0;
+ }
+
+ function swapThrows() {
+ try {
+ applicationCache.swapCache();
+ return false;
+ } catch(e) {
+ return true;
+ }
+ }
+
+ function updateThrows() {
+ try {
+ applicationCache.swapCache();
+ return false;
+ } catch(e) {
+ return true;
+ }
+ }
+
+ if (isDefined() && statusIsUncached() && swapThrows() && updateThrows())
+ log("SUCCESS");
+ else
+ log("FAILURE");
+</script>
+</body>
+</html>