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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/register-default-scope.html

Issue 2892473003: Upstream service worker "register" tests to WPT (Closed)
Patch Set: Created 3 years, 7 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/register-default-scope.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-default-scope.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-default-scope.html
deleted file mode 100644
index 575632b4b88d8482c0eca659a53bfe4566be94fa..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/register-default-scope.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html>
-<title>register() and scope</title>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="resources/test-helpers.js"></script>
-<script>
-
-promise_test(function(t) {
- var script = 'resources/empty-worker.js';
- var script_url = new URL(script, location.href);
- var expected_scope = new URL('./', script_url).href;
- return service_worker_unregister(t, expected_scope)
- .then(function() {
- return navigator.serviceWorker.register('resources/empty-worker.js');
- }).then(function(registration) {
- assert_equals(registration.scope, expected_scope,
- 'The default scope should be URL("./", script_url)');
- return registration.unregister();
- }).then(function() {
- t.done();
- });
- }, 'default scope');
-
-promise_test(function(t) {
- // This script must be different than the 'default scope' test, or else
- // the scopes will collide.
- var script = 'resources/empty.js';
- var script_url = new URL(script, location.href);
- var expected_scope = new URL('./', script_url).href;
- return service_worker_unregister(t, expected_scope)
- .then(function() {
- return navigator.serviceWorker.register('resources/empty.js',
- { scope: undefined });
- }).then(function(registration) {
- assert_equals(registration.scope, expected_scope,
- 'The default scope should be URL("./", script_url)');
- return registration.unregister();
- }).then(function() {
- t.done();
- });
- }, 'undefined scope');
-
-promise_test(function(t) {
- var script = 'resources/simple-fetch-worker.js';
- var script_url = new URL(script, location.href);
- var expected_scope = new URL('./', script_url).href;
- return service_worker_unregister(t, expected_scope)
- .then(function() {
- return navigator.serviceWorker.register('resources/empty.js',
- { scope: null });
- })
- .then(
- function(registration) {
- assert_unreached('register should fail');
- service_worker_unregister_and_done(t, registration.scope);
- },
- function(error) {
- assert_equals(error.name, 'SecurityError',
- 'passing a null scope should be interpreted as ' +
- 'scope="null" which violates the path restriction');
- t.done();
- });
- }, 'null scope');
-
-</script>

Powered by Google App Engine
This is Rietveld 408576698