1 # Copyright 2014 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.
6 from telemetry
.core
import exceptions
7 from telemetry
.page
import page
as page_module
8 from telemetry
import story
11 class SafebrowsingPage(page_module
.Page
):
14 Why: Expect 'malware ahead' page. Use a short navigation timeout because no
15 response will be received.
18 def __init__(self
, url
, page_set
, expect_timeout
):
19 super(SafebrowsingPage
, self
).__init
__(url
=url
, page_set
=page_set
)
20 self
._expect
_timeout
= expect_timeout
22 def RunNavigateSteps(self
, action_runner
):
24 action_runner
.Navigate(self
.url
, timeout_in_seconds
=5)
25 except exceptions
.TimeoutException
as e
:
26 if self
._expect
_timeout
:
27 logging
.warning('Navigation timeout on page %s', self
.url
)
32 class SafebrowsingStorySet(story
.StorySet
):
34 """ Chrome proxy test sites """
36 def __init__(self
, expect_timeout
=False):
37 super(SafebrowsingStorySet
, self
).__init
__()
40 SafebrowsingPage('http://www.ianfette.org/', self
, expect_timeout
))