diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 08:39:54 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 08:39:54 +0000 |
commit | 6fd3535a1593f4c73c938c7aa7e35eb976ccf280 (patch) | |
tree | 9a67ff8878ad611c4a35e728a613c451bb25008f /chrome/worker | |
parent | b22b5167bd0a7494a78195d04b5a77ff185de5ae (diff) | |
download | chromium_src-6fd3535a1593f4c73c938c7aa7e35eb976ccf280.zip chromium_src-6fd3535a1593f4c73c938c7aa7e35eb976ccf280.tar.gz chromium_src-6fd3535a1593f4c73c938c7aa7e35eb976ccf280.tar.bz2 |
[GTTF] Make automation framework more solid by making sure that
important return values are not ignored.
The macro used here, WARN_UNUSED_RESULT, takes effect only for GCC,
but that's enough since we have bots for all platforms.
Adding these warnings already detected some cases where a return value
was ignored. In some of them the test was trying to get the information
about success "some other way", in some it could sometimes confuse test
failure with test success.
TEST=ui_tests
BUG=none
Review URL: http://codereview.chromium.org/948002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/worker_uitest.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index 1eedc25..56bf93a 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -106,7 +106,8 @@ class WorkerTest : public UILayoutTest { // Pass a large number of navigations to tell the tab to block until an auth // dialog pops up. bool timeout = false; - tab->NavigateToURLWithTimeout(url, 100, kTestWaitTimeoutMs, &timeout); + EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, + tab->NavigateToURLWithTimeout(url, 100, kTestWaitTimeoutMs, &timeout)); EXPECT_FALSE(timeout); return tab->NeedsAuth(); } @@ -483,14 +484,16 @@ TEST_F(WorkerTest, DISABLED_LimitTotal) { ASSERT_TRUE(tab.get()); ASSERT_TRUE(tab->NavigateToURL(url)); scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(window.get()); for (int i = 1; i < tab_count; ++i) - window->AppendTab(url); + ASSERT_TRUE(window->AppendTab(url)); // Check that we didn't create more than the max number of workers. ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); // Now close a page and check that the queued workers were started. - tab->NavigateToURL(GetTestUrl(L"google", L"google.html")); + ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, + tab->NavigateToURL(GetTestUrl(L"google", L"google.html"))); ASSERT_TRUE(WaitForProcessCountToBe(tab_count, total_workers)); #endif @@ -571,7 +574,7 @@ TEST_F(WorkerTest, DISABLED_QueuedSharedWorkerStartedFromOtherTab) { scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); GURL url2 = GetTestUrl(L"workers", L"single_shared_worker.html"); url2 = GURL(url2.spec() + StringPrintf("?id=%d", max_workers_per_tab)); - window->AppendTab(url2); + ASSERT_TRUE(window->AppendTab(url2)); std::string value = WaitUntilCookieNonEmpty(tab.get(), url, kTestCompleteCookie, kTestIntervalMs, kTestWaitTimeoutMs); |