forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration test for Chrome-Proxy: pass-through directive
Checks that an image loaded with the Chrome-Proxy: pass-through directive is larger than the compressed image from the Data Reduction Proxy. BUG=490397 Review URL: https://codereview.chromium.org/1151753003 Cr-Commit-Position: refs/heads/master@{#331028}
- Loading branch information
megjablon
authored and
Commit bot
committed
May 21, 2015
1 parent
480e30a
commit 91e5715
Showing
5 changed files
with
132 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
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)) |