summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslamm@chromium.org <slamm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-22 04:15:36 +0000
committerslamm@chromium.org <slamm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-22 04:15:36 +0000
commitcfa147a850870e229cabae2cfda76df3dfee4a72 (patch)
treeb0f4bdd7ba6825ed8dae42297ece05ff92c63cd7
parentc44e6f157177d517ba781177c1c4355c50166716 (diff)
downloadchromium_src-cfa147a850870e229cabae2cfda76df3dfee4a72.zip
chromium_src-cfa147a850870e229cabae2cfda76df3dfee4a72.tar.gz
chromium_src-cfa147a850870e229cabae2cfda76df3dfee4a72.tar.bz2
Fail page_cycler-netsim test if it gets stuck on the start page.
(It currently times out after 10 minutes.) I am gearing up to re-add the test to Mac10.6 Perf(1). The last time it ran there, the test failed to start properly. If that still happens, this change would make it fail quickly. The test runs on my 10.7.4 Mac. BUG= Review URL: https://chromiumcodereview.appspot.com/10824389 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152734 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/test/functional/perf.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/test/functional/perf.py b/chrome/test/functional/perf.py
index b2b7dce..f4cbe4a 100755
--- a/chrome/test/functional/perf.py
+++ b/chrome/test/functional/perf.py
@@ -818,8 +818,8 @@ class BenchmarkPerfTest(BasePerfTest):
"""
self.assertTrue(
self.WaitUntil(
- lambda: self.ExecuteJavascript(js_is_done, tab_index=1) == 'true',
- timeout=300, retry_sleep=1),
+ lambda: self.ExecuteJavascript(js_is_done, tab_index=1),
+ timeout=300, expect_retval='true', retry_sleep=1),
msg='Timed out when waiting for SunSpider benchmark score.')
js_get_results = """
@@ -2050,6 +2050,17 @@ class BasePageCyclerTest(BasePerfTest):
'--enable-file-cookies',
'--allow-outdated-plugins'])
+ def WaitUntilStarted(self, start_url):
+ """Check that the test navigates away from the start_url."""
+ js_is_started = """
+ var is_started = document.location.href !== "%s";
+ window.domAutomationController.send(JSON.stringify(is_started));
+ """ % start_url
+ self.assertTrue(
+ self.WaitUntil(lambda: self.ExecuteJavascript(js_is_started) == 'true',
+ timeout=10),
+ msg='Timed out when waiting to leave start page.')
+
def WaitUntilDone(self, url, iterations):
"""Check cookies for "__pc_done=1" to know the test is over."""
def IsDone():
@@ -2153,6 +2164,8 @@ class BasePageCyclerTest(BasePerfTest):
iterations = self._num_iterations
start_url = self.StartUrl(name, iterations)
self.NavigateToURL(start_url)
+ if self.use_auto:
+ self.WaitUntilStarted(start_url)
self.WaitUntilDone(start_url, iterations)
pages, times = self.CollectPagesAndTimes(start_url)
final_result = self.ComputeFinalResult(pages, times, iterations)