From 5c943180e410b2a4e76f93e1612985cdab407e8c Mon Sep 17 00:00:00 2001 From: "stuartmorgan@chromium.org" Date: Tue, 7 Jul 2009 22:31:47 +0000 Subject: Sprinkle some defensiveness into the UI tests so that they don't explode if the proxy doesn't respond (e.g., due to a timeout). BUG=none TEST=Hopefully the Mac valgrind bots will more reliably run all their tests (although there are likely more issues like this lurking). Review URL: http://codereview.chromium.org/149281 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20096 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/worker/worker_uitest.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'chrome/worker') diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index 2ef25a9..e664282b 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -69,6 +69,7 @@ WorkerTest::~WorkerTest() { void WorkerTest::RunTest(const std::wstring& test_case) { scoped_refptr tab(GetActiveTab()); + ASSERT_TRUE(tab.get()); GURL url = GetTestUrl(L"workers", test_case); ASSERT_TRUE(tab->NavigateToURL(url)); @@ -206,6 +207,7 @@ void WorkerTest::RunLayoutTest(const std::string& test_case_file_name, // Runs the new layout test. scoped_refptr tab(GetActiveTab()); + ASSERT_TRUE(tab.get()); ASSERT_TRUE(tab->NavigateToURL(*new_test_url.get())); std::string escaped_value = WaitUntilCookieNonEmpty(tab.get(), *new_test_url.get(), @@ -339,6 +341,7 @@ TEST_F(WorkerTest, LimitPerPage) { url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab + 1)); scoped_refptr tab(GetActiveTab()); + ASSERT_TRUE(tab.get()); ASSERT_TRUE(tab->NavigateToURL(url)); EXPECT_EQ(max_workers_per_tab + 1 + (UITest::in_process_renderer() ? 0 : 1), @@ -354,6 +357,7 @@ TEST_F(WorkerTest, LimitTotal) { url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab)); scoped_refptr tab(GetActiveTab()); + ASSERT_TRUE(tab.get()); ASSERT_TRUE(tab->NavigateToURL(url)); scoped_refptr window(automation()->GetBrowserWindow(0)); for (int i = 1; i < tab_count; ++i) -- cgit v1.1