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

Unified Diff: third_party/WebKit/LayoutTests/inspector/user-agent-setting.html

Issue 2300403003: DevTools: patch browser's Chrome version into Chrome user agents for emulation (Closed)
Patch Set: renames 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/user-agent-setting-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/user-agent-setting.html
diff --git a/third_party/WebKit/LayoutTests/inspector/user-agent-setting.html b/third_party/WebKit/LayoutTests/inspector/user-agent-setting.html
new file mode 100644
index 0000000000000000000000000000000000000000..fea5b80a5e118b5044b5c88e8e5241f00c92a1d2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/user-agent-setting.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<meta charset="utf8">
+<script src="../http/tests/inspector/inspector-test.js"></script>
+<script src="../http/tests/inspector/network-test.js"></script>
+<script>
+
+function test()
+{
+ var cases = [
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0",
+ "GoogleChrome/%s Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36",
+ ];
+
+ for (var i = 0; i < cases.length; i++) {
+ var result = WebInspector.MultitargetNetworkManager.patchUserAgentWithChromeVersion(cases[i]);
+ InspectorTest.addResult(result);
+ }
+
+ InspectorTest.addResult("\nManually setting custom user agent");
+ WebInspector.multitargetNetworkManager.setCustomUserAgentOverride("foobar with %s inside");
+
+ InspectorTest.evaluateInPage("navigator.userAgent", step2);
+
+ function step2(result)
+ {
+ InspectorTest.addResult(result.value)
+ InspectorTest.completeTest();
+ }
+}
+
+</script>
+</head>
+<body onload="runTest()">
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/user-agent-setting-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698