| 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;
|
| ?>
|
|
|