1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 from telemetry
.page
import page
as page_module
6 from telemetry
import story
8 class PassThroughPage(page_module
.Page
):
10 A test page for the chrome proxy pass-through tests.
13 def __init__(self
, url
, page_set
):
14 super(PassThroughPage
, self
).__init
__(url
=url
, page_set
=page_set
)
16 def RunNavigateSteps(self
, action_runner
):
17 super(PassThroughPage
, self
).RunNavigateSteps(action_runner
)
18 action_runner
.ExecuteJavaScript('''
20 var request = new XMLHttpRequest();
21 request.open("GET", "%s");
22 request.setRequestHeader("Chrome-Proxy", "pass-through");
24 })();''' % (self
.url
))
28 class PassThroughStorySet(story
.StorySet
):
29 """ Chrome proxy test sites """
32 super(PassThroughStorySet
, self
).__init
__()
35 'http://check.googlezip.net/image.png',
39 self
.AddStory(PassThroughPage(url
, self
))