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

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

Issue 2745573002: Implement the events for Background Fetch (Closed)
Patch Set: more webexposed tests 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
OLDNEW
(Empty)
1 'use strict';
2
3 importScripts('/resources/testharness.js');
4
5 test(function() {
6 assert_own_property(self, 'BackgroundFetchClickEvent');
7
8 // The `tag` and `state` are required in the BackgroundFetchClickEventInit.
9 assert_throws(null, () => new BackgroundFetchClickEvent('BackgroundFetchClickE vent'));
10 assert_throws(null, () => new BackgroundFetchClickEvent('BackgroundFetchClickE vent', {}));
11 assert_throws(null, () => new BackgroundFetchClickEvent('BackgroundFetchClickE vent', { tag: 'foo' }));
12 assert_throws(null, () => new BackgroundFetchClickEvent('BackgroundFetchClickE vent', { tag: 'foo', state: 'foo' }));
13
14 // The `state` must be one of { pending, succeeded, failed }. This should not throw.
15 for (let state of ['pending', 'succeeded', 'failed'])
16 new BackgroundFetchClickEvent('BackgroundFetchClickEvent', { tag: 'foo', sta te });
17
18 const event = new BackgroundFetchClickEvent('BackgroundFetchClickEvent', {
19 tag: 'my-tag',
20 state: 'succeeded'
21 });
22
23 assert_equals(event.type, 'BackgroundFetchClickEvent');
24 assert_equals(event.cancelable, false);
25 assert_equals(event.bubbles, false);
26 assert_equals(event.tag, 'my-tag');
27 assert_equals(event.state, 'succeeded');
28
29 assert_inherits(event, 'waitUntil');
30
31 }, 'Verifies that the BackgroundFetchClickEvent can be constructed.');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698