diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2010-11-10 15:31:59 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2010-11-17 13:35:59 -0800 |
commit | 28040489d744e0c5d475a88663056c9040ed5320 (patch) | |
tree | c463676791e4a63e452a95f0a12b2a8519730693 /LayoutTests/http/tests/appcache/fallback.html | |
parent | eff9be92c41913c92fb1d3b7983c071f3e718678 (diff) | |
download | external_webkit-28040489d744e0c5d475a88663056c9040ed5320.zip external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.gz external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.bz2 |
Merge WebKit at r71558: Initial merge by git.
Change-Id: Ib345578fa29df7e4bc72b4f00e4a6fddcb754c4c
Diffstat (limited to 'LayoutTests/http/tests/appcache/fallback.html')
-rw-r--r-- | LayoutTests/http/tests/appcache/fallback.html | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/LayoutTests/http/tests/appcache/fallback.html b/LayoutTests/http/tests/appcache/fallback.html index aaf7a82..ed641e0 100644 --- a/LayoutTests/http/tests/appcache/fallback.html +++ b/LayoutTests/http/tests/appcache/fallback.html @@ -29,18 +29,6 @@ function setNetworkEnabled(state) } } -function canLoad(url) -{ - try { - var req = new XMLHttpRequest(); - req.open("GET", url, false); - req.send(""); - return true; - } catch (e) { - return false; - } -} - function load(url) { try { @@ -49,8 +37,9 @@ function load(url) req.send(""); return req.responseText; } catch (ex) { - alert("Unexpected error loading " + url + ": " + ex); + log("FAIL: Cannot load " + url + ", ex = " + ex); hadError = true; + return ""; // This value should not be expected as the responseText for a url presented to this function. } } @@ -65,17 +54,17 @@ function test() setNetworkEnabled(true); - if (!canLoad(testURL) || !/not in the cache/.test(load(testURL))) { + if (!/not in the cache/.test(load(testURL))) { log("FAIL: Cannot load an URL from fallback namespace when network is enabled"); hadError = true; } - if (!canLoad(nonexistentURL) || load(nonexistentURL) != "Hello, World!") { + if (load(nonexistentURL) != "Hello, World!") { log("FAIL: Fallback resource wasn't used for a 404 response"); hadError = true; } - if (!canLoad(redirectURL) || load(redirectURL) != "Hello, World!") { + if (load(redirectURL) != "Hello, World!") { log("FAIL: Fallback resource wasn't used for a redirect to a resource with another origin"); hadError = true; } @@ -147,10 +136,7 @@ function test6() { setNetworkEnabled(false); - if (!canLoad(testURL)) { - log("FAIL: Cannot load an URL from fallback namespace when network is disabled"); - hadError = true; - } else if (load(testURL) != load("resources/simple.txt")) { + if (load(testURL) != load("resources/simple.txt")) { log("FAIL: Loading an URL from fallback namespace when network is disabled returned unexpected response"); hadError = true; } |