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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-worker.php

Issue 2054203002: service worker: Fix the type of an update promise reject value (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: FIXME => TODO Created 4 years, 5 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/resources/update-worker.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-worker.php b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-worker.php
index 1f2ebbbc180bf81c7f83f52baff6c511aa3f7b20..81bdd1bfad1df506f65963db78f589aa40b2c9dc 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-worker.php
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/update-worker.php
@@ -8,6 +8,8 @@ else
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
+$extra_body = '';
+
if ($mode == 'init') {
// Set a normal mimetype.
// Set cookie value to 'normal' so the next fetch will work in 'normal' mode.
@@ -20,11 +22,21 @@ if ($mode == 'init') {
setcookie('mode', 'error');
} else if ($mode == 'error') {
// Set a disallowed mimetype.
- // Unset and delete cookie to clean up the test setting.
+ // Set cookie value to 'syntax-error' so the next fetch will work in 'syntax-error' mode.
header('Content-Type:text/html');
+ setcookie('mode', 'syntax-error');
+} else if ($mode == 'syntax-error') {
+ // Set cookie value to 'throw-install' so the next fetch will work in 'throw-install' mode.
+ header('Content-Type:application/javascript');
+ setcookie('mode', 'throw-install');
+ $extra_body = 'badsyntax(isbad;';
+} else if ($mode == 'throw-install') {
+ // Unset and delete cookie to clean up the test setting.
+ header('Content-Type:application/javascript');
unset($_COOKIE['mode']);
setcookie('mode', '', time() - 3600);
+ $extra_body = "addEventListener('install', function(e) { throw new Error('boom'); });";
}
// Return a different script for each access.
-echo '// ' . microtime();
+echo '/* ', microtime(), ' */ ', $extra_body;
?>

Powered by Google App Engine
This is Rietveld 408576698