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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <?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.
2 if(!isset($_COOKIE['mode']))
3 $mode = 'plain'; // For the first fetch, set the mode to plain.
4 else
5 $mode = 'error'; // For the second fetch, set the mode to error.
6
7 // Plain mode sets the normal mimetype.
8 if ($mode == 'plain') {
9 echo '// Plain mode.';
10 header("Cache-Control: no-cache, must-revalidate");
11 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
12 header('Content-Type:application/javascript');
13 setcookie('mode', 'error'); // Set cookie for 2nd fetch to work in error mode.
14 }
15 // Error mode sets a disallowed mimetype.
16 else if ($mode == 'error') {
17 echo '// Error mode.';
18 header("Cache-Control: no-cache, must-revalidate");
19 header("Pragma: no-cache");
20 header('Content-Type:text/html');
21 unset($_COOKIE['mode']);
22 setcookie('mode', '', time() - 3600); // Delete cookie at the end of the test.
23 }
24 echo '// ' . microtime();
25 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698