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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-matchall-client-types.html

Issue 2778903002: Upstream service worker `client` tests to WPT (Closed)
Patch Set: Remove unnecessary branch 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/serviceworker/clients-matchall-client-types.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-matchall-client-types.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-matchall-client-types.html
deleted file mode 100644
index a11a3cc8293668decd76e861fbd4d6405cd8a6ce..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/clients-matchall-client-types.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE html>
-<title>Service Worker: Clients.matchAll with various clientTypes</title>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="resources/test-helpers.js"></script>
-<script>
-var scope = 'resources/clients-matchall-client-types';
-var iframe_url = scope + '-iframe.html';
-var shared_worker_url = scope + '-shared-worker.js';
-
-/* visibilityState, focused, url, frameType */
-var expected_without_type = [
- ['visible', true, new URL(iframe_url, location).href, 'nested']
-];
-var expected_with_window = [
- ['visible', true, new URL(iframe_url, location).href, 'nested']
-];
-var expected_with_shared_worker = [
- [undefined, undefined, new URL(shared_worker_url, location).href, 'none']
-];
-var expected_with_all = [
- ['visible', true, new URL(iframe_url, location).href, 'nested'],
- [undefined, undefined, new URL(shared_worker_url, location).href, 'none']
-];
-
-function test_matchall(frame, expected, query_options) {
- // Make sure the frame gets focus.
- frame.focus();
- return new Promise(function(resolve, reject) {
- var channel = new MessageChannel();
- channel.port1.onmessage = function(e) { resolve(e.data); };
- frame.contentWindow.navigator.serviceWorker.controller.postMessage(
- {port:channel.port2, options:query_options},
- [channel.port2]);
- }).then(function(data) {
- assert_equals(data.length, expected.length);
- for (var i = 0; i < data.length; i++)
- assert_array_equals(data[i], expected[i]);
- });
-}
-
-promise_test(function(t) {
- var frame;
- return service_worker_unregister_and_register(
- t, 'resources/clients-matchall-worker.js', scope)
- .then(function(registration) {
- return wait_for_state(t, registration.installing, 'activated');
- })
- .then(function() { return with_iframe(iframe_url); })
- .then(function(f) {
- frame = f;
- return new Promise(function(resolve, reject) {
- var w = new SharedWorker(shared_worker_url);
- w.port.onmessage = resolve;
- });
- })
- .then(function() {
- return test_matchall(frame, expected_without_type, {});
- })
- .then(function() {
- return test_matchall(frame, expected_with_window, {type:'window'});
- })
- .then(function() {
- return test_matchall(frame, expected_with_shared_worker,
- {type:'sharedworker'});
- })
- .then(function() {
- return test_matchall(frame, expected_with_all, {type:'all'});
- })
- .then(function() {
- frame.remove();
- return service_worker_unregister_and_done(t, scope);
- });
- }, 'Verify matchAll() with various client types');
-
-</script>

Powered by Google App Engine
This is Rietveld 408576698