Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <script src = "/resources/testharness.js"></script> | |
| 3 <script src = "/resources/testharnessreport.js"></script> | |
| 4 <script src = "/serviceworker/resources/test-helpers.js"></script> | |
| 5 <script> | |
| 6 promise_test(test => { | |
| 7 const SCOPE = '../resources/useragent-header-iframe.html'; | |
| 8 const SCRIPT = '/serviceworker/resources/empty-worker.js'; | |
| 9 | |
| 10 let frame; | |
| 11 | |
| 12 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
| |
| 13 .then(r => { | |
|
horo
2016/08/24 01:38:33
ditto
| |
| 14 return wait_for_state(test, r.installing, 'activated'); | |
| 15 }) | |
| 16 .then(() => { | |
|
horo
2016/08/24 01:38:33
ditto
| |
| 17 return with_iframe(SCOPE); | |
| 18 }) | |
| 19 .then(f => { | |
| 20 frame = f; | |
| 21 }) | |
| 22 .then(() => { | |
|
horo
2016/08/24 01:38:33
ditto
| |
| 23 return frame.contentWindow.get_useragent(); | |
| 24 }) | |
| 25 .then(v => { | |
| 26 assert_true(v.length > 0); | |
| 27 }) | |
| 28 .then(() => { | |
|
horo
2016/08/24 01:38:33
ditto
| |
| 29 return frame.contentWindow.get_overridden_useragent(); | |
| 30 }) | |
| 31 .then(v => { | |
| 32 assert_equals(v, 'foobar'); | |
| 33 }) | |
| 34 .then(() => { | |
| 35 frame.remove(); | |
| 36 return service_worker_unregister(test, SCOPE); | |
| 37 }); | |
| 38 }, 'Check User-Agent header generation for requests proxied by the empty worke r'); | |
| 39 </script> | |
| OLD | NEW |