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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/geofencing/service-not-available.html

Issue 1926813004: Replace assert_promise_rejects with upstream promise_rejects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update testharness.js and rebase Created 4 years, 7 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Tests that all geofencing methods exposed on a service worker registratio n always reject if no geofencing service is available.</title> 2 <title>Tests that all geofencing methods exposed on a service worker registratio n always reject if no geofencing service is available.</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 src="../resources/testharness-helpers.js"></script> 5 <script src="../resources/testharness-helpers.js"></script>
6 <script src="../serviceworker/resources/test-helpers.js"></script> 6 <script src="../serviceworker/resources/test-helpers.js"></script>
7 <script> 7 <script>
8 var sw_url = 'resources/emptyworker.js'; 8 var sw_url = 'resources/emptyworker.js';
9 var sw_scope = 'resources/service-worker-scope' + window.location.pathname; 9 var sw_scope = 'resources/service-worker-scope' + window.location.pathname;
10 10
11 testRunner.setGeofencingMockProvider(false); 11 testRunner.setGeofencingMockProvider(false);
12 12
13 promise_test(function(test) { 13 promise_test(function(test) {
14 return assert_promise_rejects( 14 return promise_rejects(
15 test,
16 'AbortError',
15 service_worker_unregister_and_register(test, sw_url, sw_scope + '/register ') 17 service_worker_unregister_and_register(test, sw_url, sw_scope + '/register ')
16 .then(function(r) { 18 .then(function(r) {
17 return r.geofencing.registerRegion( 19 return r.geofencing.registerRegion(
18 new CircularGeofencingRegion({latitude: 37.421999, 20 new CircularGeofencingRegion({latitude: 37.421999,
19 longitude: -122.084015})); 21 longitude: -122.084015}));
20 }), 22 }),
21 'AbortError',
22 'registerRegion should fail with an AbortError'); 23 'registerRegion should fail with an AbortError');
23 }, 'registerRegion should fail'); 24 }, 'registerRegion should fail');
24 25
25 promise_test(function(test) { 26 promise_test(function(test) {
26 return assert_promise_rejects( 27 return promise_rejects(
28 test,
29 'AbortError',
27 service_worker_unregister_and_register(test, sw_url, sw_scope + '/unregist er') 30 service_worker_unregister_and_register(test, sw_url, sw_scope + '/unregist er')
28 .then(function(r) { 31 .then(function(r) {
29 return r.geofencing.unregisterRegion(''); 32 return r.geofencing.unregisterRegion('');
30 }), 33 }),
31 'AbortError',
32 'unregisterRegion should fail with an AbortError'); 34 'unregisterRegion should fail with an AbortError');
33 }, 'unregisterRegion should fail'); 35 }, 'unregisterRegion should fail');
34 36
35 promise_test(function(test) { 37 promise_test(function(test) {
36 return assert_promise_rejects( 38 return promise_rejects(
39 test,
40 'AbortError',
37 service_worker_unregister_and_register(test, sw_url, sw_scope + '/getregio ns') 41 service_worker_unregister_and_register(test, sw_url, sw_scope + '/getregio ns')
38 .then(function(r) { 42 .then(function(r) {
39 return r.geofencing.getRegisteredRegions(); 43 return r.geofencing.getRegisteredRegions();
40 }), 44 }),
41 'AbortError',
42 'getRegisteredRegions should fail with an AbortError'); 45 'getRegisteredRegions should fail with an AbortError');
43 }, 'getRegisteredRegions should fail'); 46 }, 'getRegisteredRegions should fail');
44 47
45 </script> 48 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698