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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-event-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-event-worker.js b/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-event-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..6f90ebd74d95a9950ab14d406e6fb49d3eb51a97
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-event-worker.js
@@ -0,0 +1,23 @@
+'use strict';
+
+importScripts('/resources/testharness.js');
+
+test(function() {
+ assert_own_property(self, 'BackgroundFetchEvent');
+
+ // The `tag` is required in the BackgroundFetchEventInit.
+ assert_throws(null, () => new BackgroundFetchEvent('BackgroundFetchEvent'));
+ assert_throws(null, () => new BackgroundFetchEvent('BackgroundFetchEvent', {}));
+
+ const event = new BackgroundFetchEvent('BackgroundFetchEvent', {
+ tag: 'my-tag'
+ });
+
+ assert_equals(event.type, 'BackgroundFetchEvent');
+ assert_equals(event.cancelable, false);
+ assert_equals(event.bubbles, false);
+ assert_equals(event.tag, 'my-tag');
+
+ assert_inherits(event, 'waitUntil');
+
+}, 'Verifies that the BackgroundFetchEvent can be constructed.');

Powered by Google App Engine
This is Rietveld 408576698