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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/fetch/serviceworker-proxied/useragent-header-via-empty-worker.html

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Android test Created 4 years, 3 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 <!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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698