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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/background_fetch/getTags.html

Issue 2736143003: Introduce the Background Fetch module. (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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/empty-worker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/background_fetch/getTags.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/getTags.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/getTags.html
new file mode 100644
index 0000000000000000000000000000000000000000..b6d1e9c042e0ef9f416dc9c6d1ae07058a9fae86
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/background_fetch/getTags.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Background Fetch: BackgroundFetchManager.getTags() behaviour.</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="../serviceworker/resources/test-helpers.js"></script>
+ </head>
+ <body>
+ <script>
+ // TODO(peter): Remove this test when the IDL harness test has landed as
+ // part of web platform tests.
+ test(function() {
+ assert_own_property(self, 'BackgroundFetchManager', 'BackgroundFetchManager needs to be exposed as a global.');
+ // TODO(peter): Test for the `fetch` method.
+ // TODO(peter): Test for the `get` method.
+
+ assert_own_property(BackgroundFetchManager.prototype, 'getTags');
+
+ }, 'BackgroundFetchManager should be exposed and have the expected interface in a Document.');
+
+ // TODO(peter): Move this to a WPT test when the getTags() function is able
+ // to reflect in-progress background fetches.
+ promise_test(async function(test) {
+ const workerUrl = 'resources/empty-worker.js';
+ const scope = 'resources/scope/' + location.pathname;
+
+ const registration = await service_worker_unregister_and_register(test, workerUrl, scope);
+ await wait_for_state(test, registration.installing, 'activated');
+
+ try {
+ await registration.backgroundFetch.getTags();
+ assert_unreached('getTags() is expected to throw.');
+ } catch (exception) {
+ assert_equals(exception.name, 'NotSupportedError');
+ assert_equals(exception.message, 'Not implemented yet.');
+ }
+ }, 'Change-detector test for the getTags() function.');
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/empty-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698