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

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: Address review nits Created 7 years, 2 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
(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() {
michaeln 2013/10/24 23:26:55 I'd suggest we not add this particular positive te
10 debug("Registering normal pattern");
11 return navigator.registerServiceWorker("/*", "serviceworker.js").then(
12 function(worker) {
13 debug("ServiceWorker registered.");
14 });
15 }
16 function test_registerPatternOutsideDomain() {
17 debug("Registering pattern outside domain");
18 return navigator.registerServiceWorker("http://foo.com/*", "servicewor ker.js")
19 .catch(function(e) {
20 regError = e;
21 shouldBe("'SecurityError'", "regError.name");
22 });
23 }
24 function test_registerScriptOutsideDomain() {
25 debug("Registering pattern outside domain");
26 return navigator.registerServiceWorker("/*", "http://foo.com/servicewo rker.js")
27 .catch(function(e) {
28 regError = e;
29 shouldBe("'SecurityError'", "regError.name");
30 });
31 }
32 var jsTestIsAsync = true;
33 test_registerBasics()
34 .then(test_registerPatternOutsideDomain)
35 .then(test_registerScriptOutsideDomain)
36 .then(finishJSTest, function(e) {
37 testFailed("Tests failed, exited with error:" + e.name + ": " + e.mess age);
38 finishJSTest();
39 });
40 </script>
41 <script src="/js-test-resources/js-test-post.js"></script>
42 </body>
43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698