summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 22:31:47 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 22:31:47 +0000
commit5c943180e410b2a4e76f93e1612985cdab407e8c (patch)
tree6aef67f089f4ecbd73fbdac524f7627ecfb6b6a2 /chrome/browser/download
parent23512f4ba83ab011aac513972290aa30b26785cd (diff)
downloadchromium_src-5c943180e410b2a4e76f93e1612985cdab407e8c.zip
chromium_src-5c943180e410b2a4e76f93e1612985cdab407e8c.tar.gz
chromium_src-5c943180e410b2a4e76f93e1612985cdab407e8c.tar.bz2
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
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_uitest.cc6
-rw-r--r--chrome/browser/download/save_page_uitest.cc5
2 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc
index c35bafc..8f588fc 100644
--- a/chrome/browser/download/download_uitest.cc
+++ b/chrome/browser/download/download_uitest.cc
@@ -313,7 +313,7 @@ TEST_F(DownloadTest, MAYBE_IncognitoDownload) {
// count and shelf visibility.
scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
int window_count = 0;
- automation()->GetBrowserWindowCount(&window_count);
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
ASSERT_EQ(1, window_count);
EXPECT_EQ(1, GetTabCount());
bool is_shelf_visible;
@@ -324,7 +324,7 @@ TEST_F(DownloadTest, MAYBE_IncognitoDownload) {
ASSERT_TRUE(browser->RunCommand(IDC_NEW_INCOGNITO_WINDOW));
scoped_refptr<BrowserProxy> incognito(automation()->GetBrowserWindow(1));
scoped_refptr<TabProxy> tab(incognito->GetTab(0));
- automation()->GetBrowserWindowCount(&window_count);
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
ASSERT_EQ(2, window_count);
// Download something.
@@ -339,7 +339,7 @@ TEST_F(DownloadTest, MAYBE_IncognitoDownload) {
// Close the Incognito window and don't crash.
ASSERT_TRUE(incognito->RunCommand(IDC_CLOSE_WINDOW));
- automation()->GetBrowserWindowCount(&window_count);
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
ASSERT_EQ(1, window_count);
// Verify that the regular window does not have a download shelf.
diff --git a/chrome/browser/download/save_page_uitest.cc b/chrome/browser/download/save_page_uitest.cc
index cbd10c1..fbef625 100644
--- a/chrome/browser/download/save_page_uitest.cc
+++ b/chrome/browser/download/save_page_uitest.cc
@@ -103,6 +103,7 @@ TEST_F(SavePageTest, MAYBE_SaveHTMLOnly) {
GURL url = URLRequestMockHTTPJob::GetMockUrl(
UTF8ToWide(std::string(kTestDir) + "/" + file_name));
scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(url));
WaitUntilTabCount(1);
@@ -125,6 +126,7 @@ TEST_F(SavePageTest, MAYBE_SaveCompleteHTML) {
GURL url = URLRequestMockHTTPJob::GetMockUrl(
UTF8ToWide(std::string(kTestDir) + "/" + file_name));
scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(url));
WaitUntilTabCount(1);
@@ -148,6 +150,7 @@ TEST_F(SavePageTest, NoSave) {
FilePath dir = save_dir_.AppendASCII("c_files");
scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(GURL("about:blank")));
WaitUntilTabCount(1);
@@ -169,6 +172,7 @@ TEST_F(SavePageTest, MAYBE_FilenameFromPageTitle) {
GURL url = URLRequestMockHTTPJob::GetMockUrl(
UTF8ToWide(std::string(kTestDir) + "/" + file_name));
scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(url));
WaitUntilTabCount(1);
@@ -201,6 +205,7 @@ TEST_F(SavePageTest, CleanFilenameFromPageTitle) {
GURL url = URLRequestMockHTTPJob::GetMockUrl(
UTF8ToWide(std::string(kTestDir) + "/" + file_name));
scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
ASSERT_TRUE(tab->NavigateToURL(url));
WaitUntilTabCount(1);