[Background Sync] Remove out-of-date layout test

Uncontrolled window clients should now be allowed to register one-shot
background sync events, as long as they have a registered service worker.
This patch removes the old test (which expected exactly the opposite
behaviour.) Part 3 changes the behaviour in Chromium, and a new layout test for
the correct behaviour is added in part 4.

This is part 2 of a now-four-part blink-chromium-blink dance.
Part 1: https://codereview.chromium.org/1309393003
Part 2: https://codereview.chromium.org/1324903002 (this patch)
Part 3: https://codereview.chromium.org/1316743002
Part 4: https://codereview.chromium.org/1314453003

BUG=5188884

Review URL: https://codereview.chromium.org/1324903002

git-svn-id: svn://svn.chromium.org/blink/trunk@201561 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a572f824
......@@ -51,32 +51,10 @@ promise_test(function(t) {
}, 'Background Sync API should allow one-shot syncs to be registered from ' +
'the Document scope');
promise_test(function(t) {
var url = 'resources/empty_worker.js';
var scope = 'resources/scope/background_sync/oneshot-uncontrolled.html';
var sync_manager;
var sync_registration;
// One-shot syncs can only be registered from a controlled document. This
// test creates a frame, after the service worker is active, in order to use
// its service worker registration.
return service_worker_unregister_and_register(t, url, scope)
.then(function(sw_registration) {
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 ' +
'cleared at the start of the test.');
return assert_promise_rejects(
sync_manager.register({tag: 'should fail'}),
'InvalidAccessError',
'Should throw with message "Cannot register a sync event without ' +
'a window client."');
})
.then(function() { return service_worker_unregister(t, scope); })
}, 'Background Sync API should not allow one-shot syncs to be registered ' +
'without window clients controlled by service worker');
// The test which verified that uncontrolled window clients could not register
// sync events is out-of-date, and so has been removed. Uncontrolled window
// clients should be allowed to register sync events, as long as they have a
// registered service worker.
// TODO(iclelland): Add a test which verifies the correct behaviour, as per
// crbug/518884
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment