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

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

Issue 225053005: ServiceWorker should have an interface object. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak test. 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: Registration</title> 2 <title>Service Worker: Registration</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script> 5 <script>
6 (function() { 6 (function() {
7 var t = async_test('Registering normal pattern'); 7 var t = async_test('Registering normal pattern');
8 t.step(function() { 8 t.step(function() {
9 navigator.serviceWorker.register( 9 navigator.serviceWorker.register(
10 'resources/registration-worker.js', 10 'resources/registration-worker.js',
11 {scope: '/*'} 11 {scope: '/*'}
12 ).then( 12 ).then(
13 t.step_func(function(worker) { 13 t.step_func(function(worker) {
14 assert_true(!!worker, 'Successfully registered.'); 14 assert_true(worker instanceof ServiceWorker,
15 'Successfully registered.');
15 t.done(); 16 t.done();
16 }), 17 }),
17 t.step_func(function(reason) { 18 t.step_func(function(reason) {
18 assert_unreached('Registration should succeed, but failed: ' + r eason.name); 19 assert_unreached('Registration should succeed, but failed: ' + r eason.name);
19 }) 20 })
20 ); 21 );
21 }); 22 });
22 }()); 23 }());
23 24
24 (function() { 25 (function() {
(...skipping 27 matching lines...) Expand all
52 t.step_func(function(reason) { 53 t.step_func(function(reason) {
53 assert_equals(reason.name, 'SecurityError', 54 assert_equals(reason.name, 'SecurityError',
54 'Registration script outside domain should fail wit h SecurityError.'); 55 'Registration script outside domain should fail wit h SecurityError.');
55 t.done(); 56 t.done();
56 }) 57 })
57 ); 58 );
58 }); 59 });
59 }()); 60 }());
60 61
61 </script> 62 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698