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

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

Issue 1268663003: Service Worker: Make ServiceWorkerRegistration.update() return a promise. (Blink Layout 3/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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: LayoutTests/http/tests/serviceworker/resources/update-worker-error.php
diff --git a/LayoutTests/http/tests/serviceworker/resources/update-worker-error.php b/LayoutTests/http/tests/serviceworker/resources/update-worker-error.php
new file mode 100644
index 0000000000000000000000000000000000000000..c8f43db36cfc9ca1d80d320c42c9dc0724a3fa3f
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/resources/update-worker-error.php
@@ -0,0 +1,25 @@
+<?php
nhiroki 2015/08/06 09:57:28 Can you rename this file to "update-error-worker.p
jungkees 2015/08/06 10:53:12 Sure, I'll change it.
+if(!isset($_COOKIE['mode']))
+ $mode = 'plain'; // For the first fetch, set the mode to plain.
+else
+ $mode = 'error'; // For the second fetch, set the mode to error.
+
+// Plain mode sets the normal mimetype.
+if ($mode == 'plain') {
+ echo '// Plain mode.';
+ header("Cache-Control: no-cache, must-revalidate");
+ header("Pragma: no-cache");
nhiroki 2015/08/06 09:57:28 Let me confirm my understanding... in the latest s
jungkees 2015/08/06 10:53:12 Yes, that's my understanding and intention. I noti
jungkees 2015/08/07 05:18:30 I've double-checked this with jakearchibald@. It's
+ header('Content-Type:application/javascript');
+ setcookie('mode', 'error'); // Set cookie for 2nd fetch to work in error mode.
+}
+// Error mode sets a disallowed mimetype.
+else if ($mode == 'error') {
+ echo '// Error mode.';
+ header("Cache-Control: no-cache, must-revalidate");
+ header("Pragma: no-cache");
+ header('Content-Type:text/html');
+ unset($_COOKIE['mode']);
+ setcookie('mode', '', time() - 3600); // Delete cookie at the end of the test.
+}
+echo '// ' . microtime();
+?>

Powered by Google App Engine
This is Rietveld 408576698