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

Side by Side Diff: LayoutTests/http/tests/serviceworker/registration.html

Issue 27278002: Add an Error class for ServiceWorkers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix windows Created 7 years, 1 month 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
(Empty)
1 <html>
2 <head>
3 <script src="/js-test-resources/js-test-pre.js"></script>
4 </head>
5 <body>
6 <script>
7 description("Tests if ServiceWorker registration is working")
8
9 function test_registerBasics() {
10 debug("Registering normal pattern");
11 return navigator.registerServiceWorker("/*", "serviceworker.js").then(
12 function(worker) {
13 debug("Successfully registered");
14 return worker;
15 },
16 function(e) {
17 regError = e;
18 shouldBe("'DisabledError'", "regError.name");
19 });
20 }
21 function test_registerPatternOutsideDomain() {
22 debug("Registering pattern outside domain");
23 return navigator.registerServiceWorker("http://foo.com/*", "servicewor ker.js")
24 .catch(function(e) {
25 regError = e;
26 shouldBe("'SecurityError'", "regError.name");
27 });
28 }
29 function test_registerScriptOutsideDomain() {
30 debug("Registering pattern outside domain");
31 return navigator.registerServiceWorker("/*", "http://foo.com/servicewo rker.js")
32 .catch(function(e) {
33 regError = e;
34 shouldBe("'SecurityError'", "regError.name");
35 });
36 }
37 var jsTestIsAsync = true;
38 test_registerBasics()
39 .then(test_registerPatternOutsideDomain)
40 .then(test_registerScriptOutsideDomain)
41 .then(finishJSTest, function(e) {
42 testFailed("Tests failed, exited with error:" + e.name + ": " + e.mess age);
43 finishJSTest();
44 });
45 </script>
46 <script src="/js-test-resources/js-test-post.js"></script>
47 </body>
48 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/serviceworker/registration-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698