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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/resources/useragent-header-iframe.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/resources/useragent-header-iframe.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/resources/useragent-header-iframe.html b/third_party/WebKit/LayoutTests/http/tests/fetch/resources/useragent-header-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..1a894590d8fe527f3ad47d4448eccc4d3bc2505a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/resources/useragent-header-iframe.html
@@ -0,0 +1,22 @@
+<script src = "useragent-header.js"></script>
+<script>
+function get_useragent() {
+ return fetch('/resources/echo-headers.php')
+ .then(response => {
horo 2016/08/24 01:38:33 you don't need brackets and "return". .then(respon
+ return response.text();
+ })
+ .then(body => {
horo 2016/08/24 01:38:33 ditto .then(body => parse_response(body))
+ return parse_response(body);
+ });
+}
+
+function get_overridden_useragent() {
+ return fetch('/resources/echo-headers.php', {headers: {'user-agent': 'foobar'}})
+ .then(response => {
horo 2016/08/24 01:38:33 ditto .then(response => response.text())
+ return response.text();
+ })
+ .then(body => {
horo 2016/08/24 01:38:33 ditto .then(body => parse_response(body))
+ return parse_response(body);
+ });
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698