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

Unified Diff: tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py

Issue 1151753003: Integration test for Chrome-Proxy: pass-through directive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@loFiSnackbar
Patch Set: comments Created 5 years, 7 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 | « tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698