Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/fetch/serviceworker-proxied/useragent-header-via-empty-worker.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/serviceworker-proxied/useragent-header-via-empty-worker.html b/third_party/WebKit/LayoutTests/http/tests/fetch/serviceworker-proxied/useragent-header-via-empty-worker.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0fd5b7c30caaa46742d209c398a2720aac854327 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/fetch/serviceworker-proxied/useragent-header-via-empty-worker.html |
| @@ -0,0 +1,39 @@ |
| +<!doctype html> |
| +<script src = "/resources/testharness.js"></script> |
| +<script src = "/resources/testharnessreport.js"></script> |
| +<script src = "/serviceworker/resources/test-helpers.js"></script> |
| +<script> |
| +promise_test(test => { |
| + const SCOPE = '../resources/useragent-header-iframe.html'; |
| + const SCRIPT = '/serviceworker/resources/empty-worker.js'; |
| + |
| + let frame; |
| + |
| + return service_worker_unregister_and_register(test, SCRIPT, SCOPE) |
|
horo
2016/08/24 01:38:33
You can't register the SCRIPT to the SCOPE.
SCOPE
|
| + .then(r => { |
|
horo
2016/08/24 01:38:33
ditto
|
| + return wait_for_state(test, r.installing, 'activated'); |
| + }) |
| + .then(() => { |
|
horo
2016/08/24 01:38:33
ditto
|
| + return with_iframe(SCOPE); |
| + }) |
| + .then(f => { |
| + frame = f; |
| + }) |
| + .then(() => { |
|
horo
2016/08/24 01:38:33
ditto
|
| + return frame.contentWindow.get_useragent(); |
| + }) |
| + .then(v => { |
| + assert_true(v.length > 0); |
| + }) |
| + .then(() => { |
|
horo
2016/08/24 01:38:33
ditto
|
| + return frame.contentWindow.get_overridden_useragent(); |
| + }) |
| + .then(v => { |
| + assert_equals(v, 'foobar'); |
| + }) |
| + .then(() => { |
| + frame.remove(); |
| + return service_worker_unregister(test, SCOPE); |
| + }); |
| + }, 'Check User-Agent header generation for requests proxied by the empty worker'); |
| +</script> |