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

Side by Side Diff: LayoutTests/http/tests/background_sync/oneshot.html

Issue 1324903002: [Background Sync] Remove out-of-date layout test (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix typo Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>Background Sync API: Verifies that the one-shot sync API works 3 <title>Background Sync API: Verifies that the one-shot sync API works
4 correctly.</title> 4 correctly.</title>
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharness-helpers.js"></script> 6 <script src="../resources/testharness-helpers.js"></script>
7 <script src="../resources/testharnessreport.js"></script> 7 <script src="../resources/testharnessreport.js"></script>
8 <script src="../serviceworker/resources/test-helpers.js"></script> 8 <script src="../serviceworker/resources/test-helpers.js"></script>
9 <script src="resources/test-helpers.js"></script> 9 <script src="resources/test-helpers.js"></script>
10 <script> 10 <script>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 assert_class_string(sync_registration, 'SyncRegistration', 'One-' + 44 assert_class_string(sync_registration, 'SyncRegistration', 'One-' +
45 'shot sync registrations should have the correct ' + 45 'shot sync registrations should have the correct ' +
46 'class name.'); 46 'class name.');
47 assert_equals('abcde', registration.tag, 'Sync registration tag ' + 47 assert_equals('abcde', registration.tag, 'Sync registration tag ' +
48 'returned should match the tag registered.'); 48 'returned should match the tag registered.');
49 return service_worker_unregister(t, scope); 49 return service_worker_unregister(t, scope);
50 }); 50 });
51 }, 'Background Sync API should allow one-shot syncs to be registered from ' + 51 }, 'Background Sync API should allow one-shot syncs to be registered from ' +
52 'the Document scope'); 52 'the Document scope');
53 53
54 promise_test(function(t) { 54 // The test which verified that uncontrolled window clients could not register
55 var url = 'resources/empty_worker.js'; 55 // sync events is out-of-date, and so has been removed. Uncontrolled window
56 var scope = 'resources/scope/background_sync/oneshot-uncontrolled.html'; 56 // clients should be allowed to register sync events, as long as they have a
57 var sync_manager; 57 // registered service worker.
58 var sync_registration; 58 // TODO(iclelland): Add a test which verifies the correct behaviour, as per
59 59 // crbug/518884
60 // One-shot syncs can only be registered from a controlled document. This
61 // test creates a frame, after the service worker is active, in order to use
62 // its service worker registration.
63 return service_worker_unregister_and_register(t, url, scope)
64 .then(function(sw_registration) {
65 sync_manager = sw_registration.sync;
66 return wait_for_state(t, sw_registration.installing, 'activated');
67 })
68 .then(function() { return clear_registered_syncs(sync_manager); })
69 .then(function() { return sync_manager.getRegistrations(); })
70 .then(function(registrations) {
71 assert_equals(registrations.length, 0, 'One-shot syncs should be ' +
72 'cleared at the start of the test.');
73 return assert_promise_rejects(
74 sync_manager.register({tag: 'should fail'}),
75 'InvalidAccessError',
76 'Should throw with message "Cannot register a sync event without ' +
77 'a window client."');
78 })
79 .then(function() { return service_worker_unregister(t, scope); })
80 }, 'Background Sync API should not allow one-shot syncs to be registered ' +
81 'without window clients controlled by service worker');
82 </script> 60 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698