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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698