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

Side by Side Diff: LayoutTests/http/tests/appcache/wrong-signature-2.html

Issue 217133002: AppCache error details tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: statusCode -> status Created 6 years, 8 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="resources/wrong-signature-2.manifest"> 1 <html manifest="resources/wrong-signature-2.manifest">
2 <body> 2 <script src="/js-test-resources/js-test.js"></script>
3 <p>Test that a manifest served with a wrong signature isn't treated as such.</p>
4 <p>Should say SUCCESS:</p>
5 <div id=result></div>
6 <script> 3 <script>
7 if (window.testRunner) { 4 var jsTestIsAsync = true;
8 testRunner.dumpAsText() 5 description("Test that a manifest served with a wrong signature isn't treated as such.");
9 testRunner.waitUntilDone(); 6
7 function unexpectedEvent(name)
8 {
9 testFailed("Unexpected " + name + " event.");
10 finishJSTest();
10 } 11 }
11 12
12 function log(message) 13 function test(e)
13 { 14 {
14 document.getElementById("result").innerHTML += message + "<br>"; 15 shouldBe("window.applicationCache.status", "applicationCache.UNCACHED");
16
17 event = e;
18 shouldBeEqualToString("event.reason", "signature");
19 shouldBeEqualToString("event.url", "");
20 shouldBe("event.status", "0");
21 shouldBeTrue("'message' in event");
22
23 finishJSTest();
15 } 24 }
16 25
17 function cacheCallback() 26 applicationCache.addEventListener('cached', function() { unexpectedEvent("cached "); }, false);
18 { 27 applicationCache.addEventListener('noupdate', function() { unexpectedEvent("noup date"); }, false);
19 log("FAIL: An event was dispatched on window.applicationCache, even though i t was not associated wuth any cache yet.");
20 }
21
22 function test()
23 {
24 // Wait for cache update to finish.
25 if (window.applicationCache.status != window.applicationCache.UNCACHED)
26 log("FAILURE: Unexpected cache status: " + window.applicationCache.statu s);
27 else
28 log("SUCCESS");
29
30 if (window.testRunner)
31 testRunner.notifyDone();
32 }
33
34 applicationCache.addEventListener('cached', function() { log("cached"); cacheCal lback() }, false);
35 applicationCache.addEventListener('noupdate', function() { log("noupdate"); cach eCallback() }, false);
36 applicationCache.addEventListener('error', test, false); 28 applicationCache.addEventListener('error', test, false);
37 29
38 </script> 30 </script>
39 </body> 31 </body>
40 </html> 32 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/appcache/wrong-signature.html ('k') | LayoutTests/http/tests/appcache/wrong-signature-2-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698