Chromium Code Reviews| 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..44617a738247b084a509f7f1170c38741e7d504c |
| --- /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", "http://aws1.mdw.la/fw/buddy.jpg"); |
|
sclittle
2015/05/21 01:54:24
Also, don't hardcode the url here, just use |self.
sclittle
2015/05/21 01:54:25
Please use something off of check.googlezip.net, w
megjablon
2015/05/21 19:03:07
Done.
|
| + request.setRequestHeader("Chrome-Proxy","pass-through"); |
|
sclittle
2015/05/21 01:54:25
nit: add space after comma
Not at Google. Contact bengr
2015/05/21 18:29:00
For this test to be meaningful, "Chrome-Proxy: pas
sclittle
2015/05/21 18:43:05
@kundaji:
IIRC the "Chrome-Proxy: pass-through" r
Not at Google. Contact bengr
2015/05/21 18:53:54
You are right: I forgot that Telemetry does not al
megjablon
2015/05/21 19:03:07
Done.
|
| + request.send(null); |
| + })();''') |
| + action_runner.Wait(1) |
| + |
| + |
| +class PassThroughPageSet(page_set_module.PageSet): |
| + """ Chrome proxy test sites """ |
| + |
| + def __init__(self): |
| + super(PassThroughPageSet, self).__init__() |
| + |
| + urls_list = [ |
| + 'http://aws1.mdw.la/fw/buddy.jpg', |
|
sclittle
2015/05/21 01:54:25
same here, use http://check.googlezip.net/image.pn
megjablon
2015/05/21 19:03:07
Done.
|
| + ] |
| + |
| + for url in urls_list: |
| + self.AddUserStory(PassThroughPage(url, self)) |