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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-fail-event-worker.js

Issue 2751523008: Update Background Fetch IDLs following spec changes (Closed)
Patch Set: Update Background Fetch IDLs following spec changes Created 3 years, 9 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 | third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetched-event-worker.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 'use strict'; 1 'use strict';
2 2
3 importScripts('/resources/testharness.js'); 3 importScripts('/resources/testharness.js');
4 4
5 test(function() { 5 test(function() {
6 assert_own_property(self, 'BackgroundFetchFailEvent'); 6 assert_own_property(self, 'BackgroundFetchFailEvent');
7 7
8 // The `tag` and `failedFetches` are required options in the 8 // The `tag` and `fetches` are required options in the
9 // BackgroundFetchFailEventInit. The latter must be a sequence of 9 // BackgroundFetchFailEventInit. The latter must be a sequence of
10 // BackgroundFetchSettledRequest instances. 10 // BackgroundFetchSettledFetch instances.
11 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt')); 11 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt'));
12 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt', {})); 12 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt', {}));
13 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt', { tag: 'foo' })); 13 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt', { tag: 'foo' }));
14 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt', { tag: 'foo', failedFetches: 'bar' })); 14 assert_throws(null, () => new BackgroundFetchFailEvent('BackgroundFetchFailEve nt', { tag: 'foo', fetches: 'bar' }));
15 15
16 const failedFetches = [ 16 const fetches = [
17 new BackgroundFetchSettledRequest(new Request('non-existing-image.png'), new Response()), 17 new BackgroundFetchSettledFetch(new Request('non-existing-image.png'), new R esponse()),
18 new BackgroundFetchSettledRequest(new Request('non-existing-image-2.png'), n ew Response()) 18 new BackgroundFetchSettledFetch(new Request('non-existing-image-2.png'), new Response())
19 ]; 19 ];
20 20
21 const event = new BackgroundFetchFailEvent('BackgroundFetchFailEvent', { 21 const event = new BackgroundFetchFailEvent('BackgroundFetchFailEvent', {
22 tag: 'my-tag', 22 tag: 'my-tag',
23 failedFetches 23 fetches
24 }); 24 });
25 25
26 assert_equals(event.type, 'BackgroundFetchFailEvent'); 26 assert_equals(event.type, 'BackgroundFetchFailEvent');
27 assert_equals(event.cancelable, false); 27 assert_equals(event.cancelable, false);
28 assert_equals(event.bubbles, false); 28 assert_equals(event.bubbles, false);
29 assert_equals(event.tag, 'my-tag'); 29 assert_equals(event.tag, 'my-tag');
30 30
31 assert_true(Array.isArray(event.failedFetches)); 31 assert_true(Array.isArray(event.fetches));
32 assert_array_equals(event.failedFetches, failedFetches); 32 assert_array_equals(event.fetches, fetches);
33 33
34 assert_inherits(event, 'waitUntil'); 34 assert_inherits(event, 'waitUntil');
35 35
36 }, 'Verifies that the BackgroundFetchFailEvent can be constructed.'); 36 }, 'Verifies that the BackgroundFetchFailEvent can be constructed.');
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetched-event-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698