Index: third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot.html b/third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot.html |
index 87663fa605934e6ff869de26d4fa917abeda20db..877732c29f6945c1dbee07737d5c1eb8f6372ac2 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot.html |
@@ -6,7 +6,6 @@ |
<script src="../resources/testharness-helpers.js"></script> |
<script src="../resources/testharnessreport.js"></script> |
<script src="../serviceworker/resources/test-helpers.js"></script> |
-<script src="resources/test-helpers.js"></script> |
<script> |
promise_test(function(t) { |
@@ -31,21 +30,14 @@ promise_test(function(t) { |
}) |
.then(function(sw_registration_frame) { |
sync_manager = sw_registration_frame.sync; |
- return clear_registered_syncs(sync_manager); |
+ return sync_manager.getTags(); |
}) |
- .then(function() { return sync_manager.getRegistrations(); }) |
- .then(function(registrations) { |
- assert_equals(registrations.length, 0, 'One-shot syncs should be ' + |
+ .then(function(tags) { |
+ assert_equals(tags.length, 0, 'One-shot syncs should be ' + |
'cleared at the start of the test.'); |
- return sync_manager.register({tag: 'abcde'}); |
+ return sync_manager.register('abcde'); |
}) |
- .then(function(registration) { |
- sync_registration = registration; |
- assert_class_string(sync_registration, 'SyncRegistration', 'One-' + |
- 'shot sync registrations should have the correct ' + |
- 'class name.'); |
- assert_equals('abcde', registration.tag, 'Sync registration tag ' + |
- 'returned should match the tag registered.'); |
+ .then(function() { |
return service_worker_unregister(t, scope); |
}); |
}, 'Background Sync API should allow one-shot syncs to be registered from ' + |
@@ -65,23 +57,15 @@ promise_test(function(t) { |
sync_manager = sw_registration.sync; |
return wait_for_state(t, sw_registration.installing, 'activated'); |
}) |
- .then(function() { return clear_registered_syncs(sync_manager); }) |
- .then(function() { return sync_manager.getRegistrations(); }) |
- .then(function(registrations) { |
- assert_equals(registrations.length, 0, 'One-shot syncs should be ' + |
+ .then(function() { return sync_manager.getTags(); }) |
+ .then(function(tags) { |
+ assert_equals(tags.length, 0, 'One-shot syncs should be ' + |
'cleared at the start of the test.'); |
- return sync_manager.register({tag: 'abcde'}); |
+ return sync_manager.register('abcde'); |
}) |
- .then(function(registration) { |
- sync_registration = registration; |
- assert_class_string(sync_registration, 'SyncRegistration', 'One-' + |
- 'shot sync registrations should have the correct ' + |
- 'class name.'); |
- assert_equals('abcde', registration.tag, 'Sync registration tag ' + |
- 'returned should match the tag registered.'); |
+ .then(function() { |
return service_worker_unregister(t, scope); |
}) |
- .then(function() { return service_worker_unregister(t, scope); }) |
}, 'Background Sync API should allow one-shot syncs to be registered ' + |
'with window clients not currently controlled by service worker'); |
</script> |