diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-22 13:26:46 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-22 13:26:46 +0000 |
commit | 1a96b432de916d958dd03404701405c981fbaff3 (patch) | |
tree | 95b1e48eb425c67f139980834e61e848094786e7 /chrome/test/reliability | |
parent | 99ad6c9c402c3453044928a6e4414e695feb9200 (diff) | |
download | chromium_src-1a96b432de916d958dd03404701405c981fbaff3.zip chromium_src-1a96b432de916d958dd03404701405c981fbaff3.tar.gz chromium_src-1a96b432de916d958dd03404701405c981fbaff3.tar.bz2 |
[GTTF] Reduce number of automation methods ending with WithTimeout.
They are just too easy to misuse. People started inventing their own
hardcoded timeouts all over the place.
Also, the is_timeout return parameter was not checked consistently.
Additionally, some calls actually had no timeout at all, making
hangs possible.
This change also removes useless DLOG statements. We should get the
required info from the ASSERT/EXPECT macros in test code, which is
quite well checked by WARN_UNUSED_RESULT.
TEST=all ui-based
BUG=none
Review URL: http://codereview.chromium.org/1076005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/reliability')
-rw-r--r-- | chrome/test/reliability/page_load_test.cc | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index bac5fa1..041ab1f 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -185,19 +185,16 @@ class PageLoadTest : public UITest { test_log << "browser_launched_seconds="; test_log << (time_now.ToDoubleT() - time_start) << std::endl; - bool is_timeout = false; int result = AUTOMATION_MSG_NAVIGATION_ERROR; // This is essentially what NavigateToURL does except we don't fire // assertion when page loading fails. We log the result instead. { // TabProxy should be released before Browser is closed. scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); - if (tab_proxy.get()) { - result = tab_proxy->NavigateToURLWithTimeout(url, 1, g_timeout_ms, - &is_timeout); - } + if (tab_proxy.get()) + result = tab_proxy->NavigateToURL(url); - if (!is_timeout && result == AUTOMATION_MSG_NAVIGATION_SUCCESS) { + if (result == AUTOMATION_MSG_NAVIGATION_SUCCESS) { if (g_page_down) { // Page down twice. scoped_refptr<BrowserProxy> browser( @@ -205,11 +202,7 @@ class PageLoadTest : public UITest { if (browser.get()) { scoped_refptr<WindowProxy> window(browser->GetWindow()); if (window.get()) { - bool activation_timeout; - bool success = - browser->BringToFrontWithTimeout(action_max_timeout_ms(), - &activation_timeout); - if (success && !activation_timeout) { + if (browser->BringToFront()) { window->SimulateOSKeyPress(base::VKEY_NEXT, 0); PlatformThread::Sleep(sleep_timeout_ms()); window->SimulateOSKeyPress(base::VKEY_NEXT, 0); @@ -241,31 +234,19 @@ class PageLoadTest : public UITest { // <url> <navigation_result> <browser_crash_count> <renderer_crash_count> // <plugin_crash_count> <crash_dump_count> [chrome_log=<path> // v8_log=<path>] crash_dump=<path> - if (is_timeout) { - metrics.result = NAVIGATION_TIME_OUT; - // After timeout, the test automation is in the transition state since - // there might be pending IPC messages and the browser (automation - // provider) is still working on the request. Here we just skip the url - // and send the next request. The pending IPC messages will be properly - // discarded by automation message filter. The browser will accept the - // new request and visit the next URL. - // We will revisit the issue if we encounter the situation where browser - // needs to be restarted after timeout. - } else { - switch (result) { - case AUTOMATION_MSG_NAVIGATION_ERROR: - metrics.result = NAVIGATION_ERROR; - break; - case AUTOMATION_MSG_NAVIGATION_SUCCESS: - metrics.result = NAVIGATION_SUCCESS; - break; - case AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED: - metrics.result = NAVIGATION_AUTH_NEEDED; - break; - default: - metrics.result = NAVIGATION_ERROR; - break; - } + switch (result) { + case AUTOMATION_MSG_NAVIGATION_ERROR: + metrics.result = NAVIGATION_ERROR; + break; + case AUTOMATION_MSG_NAVIGATION_SUCCESS: + metrics.result = NAVIGATION_SUCCESS; + break; + case AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED: + metrics.result = NAVIGATION_AUTH_NEEDED; + break; + default: + metrics.result = NAVIGATION_ERROR; + break; } if (log_file.is_open()) { |