Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: LayoutTests/http/tests/appcache/resources/remove-cache-frame-2.html

Issue 23702040: Send synchronous loads through the cache. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html manifest="fail-on-update.php"> 1 <html manifest="fail-on-update.php">
2 <body> 2 <body>
3 <div id=result></div> 3 <div id=result></div>
4 <script> 4 <script>
5 function log(message) 5 function log(message)
6 { 6 {
7 document.getElementById("result").innerHTML += message + "<br>"; 7 document.getElementById("result").innerHTML += message + "<br>";
8 } 8 }
9 9
10 function test() 10 function test()
11 { 11 {
12 log("cached") 12 log("cached")
13 log("status=" + applicationCache.status); 13 log("status=" + applicationCache.status);
14 applicationCache.onnoupdate = null; 14 applicationCache.onnoupdate = null;
15 15
16 // Associated to a cache, so loading should fail 16 // Associated to a cache, so loading should fail
17 try { 17 try {
18 var req = new XMLHttpRequest; 18 var req = new XMLHttpRequest;
19 req.open("GET", "empty.txt", false); 19 req.open("GET", "empty.txt", false);
20 req.setRequestHeader("Cache-control", "no-store");
20 req.send(null); 21 req.send(null);
21 alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exc eption"); 22 alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exc eption");
22 } catch (ex) { 23 } catch (ex) {
23 } 24 }
24 log("There should be no messages below."); 25 log("There should be no messages below.");
25 parent.postMessage("frameDone", "*"); 26 parent.postMessage("frameDone", "*");
26 } 27 }
27 28
28 applicationCache.onupdateready = function() { log("updateready"); alert("Unexpec ted onupdateready event in frame") } 29 applicationCache.onupdateready = function() { log("updateready"); alert("Unexpec ted onupdateready event in frame") }
29 applicationCache.onerror = function() { log("error"); alert("Unexpected error ev ent in frame") } 30 applicationCache.onerror = function() { log("error"); alert("Unexpected error ev ent in frame") }
30 applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected no update event in frame") } 31 applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected no update event in frame") }
31 applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected ob solete event in frame") } 32 applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected ob solete event in frame") }
32 33
33 applicationCache.oncached = test; 34 applicationCache.oncached = test;
34 35
35 </script> 36 </script>
36 </body> 37 </body>
37 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698