Index: tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py |
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py b/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d2e1623f890a9770e2224e69238b8fc0415137ad |
--- /dev/null |
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py |
@@ -0,0 +1,39 @@ |
+# Copyright 2015 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+from telemetry.page import page as page_module |
+from telemetry.page import page_set as page_set_module |
+ |
+class PassThroughPage(page_module.Page): |
+ """ |
+ A test page for the chrome proxy pass-through tests. |
+ """ |
+ |
+ def __init__(self, url, page_set): |
+ super(PassThroughPage, self).__init__(url=url, page_set=page_set) |
+ |
+ def RunNavigateSteps(self, action_runner): |
+ super(PassThroughPage, self).RunNavigateSteps(action_runner) |
+ action_runner.ExecuteJavaScript(''' |
+ (function() { |
+ var request = new XMLHttpRequest(); |
+ request.open("GET", "%s"); |
+ request.setRequestHeader("Chrome-Proxy","pass-through"); |
sclittle
2015/05/21 19:28:56
nit: add space after comma
megjablon
2015/05/21 19:41:34
Ah fixed it and then un-did it. Fixed!
|
+ request.send(null); |
+ })();''' % (self.url)) |
+ action_runner.Wait(1) |
+ |
+ |
+class PassThroughPageSet(page_set_module.PageSet): |
+ """ Chrome proxy test sites """ |
+ |
+ def __init__(self): |
+ super(PassThroughPageSet, self).__init__() |
+ |
+ urls_list = [ |
+ 'http://check.googlezip.net/image.png', |
+ ] |
+ |
+ for url in urls_list: |
+ self.AddUserStory(PassThroughPage(url, self)) |