summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 08:39:54 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 08:39:54 +0000
commit6fd3535a1593f4c73c938c7aa7e35eb976ccf280 (patch)
tree9a67ff8878ad611c4a35e728a613c451bb25008f /chrome/browser
parentb22b5167bd0a7494a78195d04b5a77ff185de5ae (diff)
downloadchromium_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/browser')
-rw-r--r--chrome/browser/browser_encoding_uitest.cc3
-rw-r--r--chrome/browser/browser_uitest.cc5
-rw-r--r--chrome/browser/dom_ui/new_tab_ui_uitest.cc6
-rw-r--r--chrome/browser/download/download_uitest.cc8
-rw-r--r--chrome/browser/history/redirect_uitest.cc2
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_uitest.cc2
-rw-r--r--chrome/browser/metrics/metrics_service_uitest.cc2
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc35
-rw-r--r--chrome/browser/sessions/session_restore_uitest.cc8
-rw-r--r--chrome/browser/tab_contents/view_source_uitest.cc4
-rw-r--r--chrome/browser/tab_restore_uitest.cc60
11 files changed, 72 insertions, 63 deletions
diff --git a/chrome/browser/browser_encoding_uitest.cc b/chrome/browser/browser_encoding_uitest.cc
index 8d68314..c5c3eb7 100644
--- a/chrome/browser/browser_encoding_uitest.cc
+++ b/chrome/browser/browser_encoding_uitest.cc
@@ -242,7 +242,8 @@ TEST_F(BrowserEncodingTest, TestEncodingAutoDetect) {
// Set the default charset to one of encodings not supported by the current
// auto-detector (Please refer to the above comments) to make sure we
// incorrectly decode the page. Now we use ISO-8859-4.
- browser->SetStringPreference(prefs::kDefaultCharset, L"ISO-8859-4");
+ ASSERT_TRUE(browser->SetStringPreference(prefs::kDefaultCharset,
+ L"ISO-8859-4"));
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_TRUE(tab.get());
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc
index 55cb332..324d3cc 100644
--- a/chrome/browser/browser_uitest.cc
+++ b/chrome/browser/browser_uitest.cc
@@ -39,7 +39,7 @@ class BrowserTest : public UITest {
#elif defined(OS_POSIX)
// There's nothing to do here if the browser is not running.
if (IsBrowserRunning()) {
- automation()->SetFilteredInet(false);
+ EXPECT_TRUE(automation()->SetFilteredInet(false));
int window_count = 0;
EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count));
@@ -193,7 +193,8 @@ TEST_F(BrowserTest, MAYBE_OtherRedirectsDontForkProcess) {
// Start with a file:// url
test_file = test_file.AppendASCII("title2.html");
- tab->NavigateToURL(net::FilePathToFileURL(test_file));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(net::FilePathToFileURL(test_file)));
int orig_tab_count = -1;
ASSERT_TRUE(window->GetTabCount(&orig_tab_count));
int orig_process_count = GetBrowserProcessCount();
diff --git a/chrome/browser/dom_ui/new_tab_ui_uitest.cc b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
index 2235bf9..21d7a20 100644
--- a/chrome/browser/dom_ui/new_tab_ui_uitest.cc
+++ b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
@@ -38,7 +38,7 @@ TEST_F(NewTabUITest, NTPHasThumbnails) {
ASSERT_EQ(1, tab_count);
// Bring up a new tab page.
- window->RunCommand(IDC_NEW_TAB);
+ ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB));
ASSERT_TRUE(window->GetTabCount(&tab_count));
ASSERT_EQ(2, tab_count);
int load_time;
@@ -76,7 +76,7 @@ TEST_F(NewTabUITest, ChromeInternalLoadsNTP) {
// Go to the "new tab page" using its old url, rather than chrome://newtab.
scoped_refptr<TabProxy> tab = window->GetTab(0);
ASSERT_TRUE(tab.get());
- tab->NavigateToURLAsync(GURL("chrome-internal:"));
+ ASSERT_TRUE(tab->NavigateToURLAsync(GURL("chrome-internal:")));
int load_time;
ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
@@ -123,7 +123,7 @@ TEST_F(NewTabUITest, HomePageLink) {
ASSERT_EQ(1, tab_count);
// Bring up a new tab page.
- browser->RunCommand(IDC_NEW_TAB);
+ ASSERT_TRUE(browser->RunCommand(IDC_NEW_TAB));
ASSERT_TRUE(browser->GetTabCount(&tab_count));
ASSERT_EQ(2, tab_count);
int load_time;
diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc
index 17aa989..2649364 100644
--- a/chrome/browser/download/download_uitest.cc
+++ b/chrome/browser/download/download_uitest.cc
@@ -274,11 +274,11 @@ TEST_F(DownloadTest, FLAKY_PerWindowShelf) {
EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get()));
// Open a second tab
- browser->AppendTab(GURL());
+ ASSERT_TRUE(browser->AppendTab(GURL()));
WaitUntilTabCount(2);
// Hide shelf
- browser->SetShelfVisible(false);
+ EXPECT_TRUE(browser->SetShelfVisible(false));
EXPECT_TRUE(WaitForDownloadShelfInvisible(browser.get()));
// Go to first tab
@@ -333,7 +333,7 @@ TEST_F(DownloadTest, FLAKY_IncognitoDownload) {
ASSERT_EQ(1, window_count);
EXPECT_EQ(1, GetTabCount());
bool is_shelf_visible;
- browser->IsShelfVisible(&is_shelf_visible);
+ EXPECT_TRUE(browser->IsShelfVisible(&is_shelf_visible));
EXPECT_FALSE(is_shelf_visible);
// Open an Incognito window.
@@ -359,7 +359,7 @@ TEST_F(DownloadTest, FLAKY_IncognitoDownload) {
ASSERT_EQ(1, window_count);
// Verify that the regular window does not have a download shelf.
- browser->IsShelfVisible(&is_shelf_visible);
+ EXPECT_TRUE(browser->IsShelfVisible(&is_shelf_visible));
EXPECT_FALSE(is_shelf_visible);
CleanUpDownload(file);
diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc
index 53c238d..976d91b 100644
--- a/chrome/browser/history/redirect_uitest.cc
+++ b/chrome/browser/history/redirect_uitest.cc
@@ -216,7 +216,7 @@ TEST_F(RedirectTest, NoHttpToFile) {
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
std::wstring actual_title;
- tab_proxy->GetTabTitle(&actual_title);
+ ASSERT_TRUE(tab_proxy->GetTabTitle(&actual_title));
EXPECT_NE(L"File!", actual_title);
}
diff --git a/chrome/browser/in_process_webkit/dom_storage_uitest.cc b/chrome/browser/in_process_webkit/dom_storage_uitest.cc
index 8b8a66d..88cfa871 100644
--- a/chrome/browser/in_process_webkit/dom_storage_uitest.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_uitest.cc
@@ -69,7 +69,7 @@ class DOMStorageTest : public UILayoutTest {
ASSERT_TRUE(tab.get());
GURL url = GetTestUrl(L"layout_tests", L"clear_dom_storage.html");
- tab->SetCookie(url, "");
+ ASSERT_TRUE(tab->SetCookie(url, ""));
ASSERT_TRUE(tab->NavigateToURL(url));
WaitUntilCookieNonEmpty(tab.get(), url, "cleared", kTestIntervalMs,
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc
index d5f4524..9ae51eb 100644
--- a/chrome/browser/metrics/metrics_service_uitest.cc
+++ b/chrome/browser/metrics/metrics_service_uitest.cc
@@ -97,7 +97,7 @@ TEST_F(MetricsServiceTest, CrashRenderers) {
#if defined(OS_WIN)
expected_crashes_ = 1;
#endif
- tab->NavigateToURLAsync(GURL("about:crash"));
+ ASSERT_TRUE(tab->NavigateToURLAsync(GURL("about:crash")));
}
// Give the browser a chance to notice the crashed tab.
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 5b3bc5b..5e1d75a 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -86,8 +86,9 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest) {
ASSERT_TRUE(browser_proxy.get());
scoped_refptr<TabProxy> tab(browser_proxy->GetActiveTab());
ASSERT_TRUE(tab.get());
- tab->NavigateToURL(server->TestServerPageW(
- L"files/sync_xmlhttprequest.html"));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(server->TestServerPageW(
+ L"files/sync_xmlhttprequest.html")));
// Let's check the XMLHttpRequest ran successfully.
bool success = false;
@@ -107,8 +108,9 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_Disallowed) {
ASSERT_TRUE(browser_proxy.get());
scoped_refptr<TabProxy> tab(browser_proxy->GetActiveTab());
ASSERT_TRUE(tab.get());
- tab->NavigateToURL(server->TestServerPageW(
- L"files/sync_xmlhttprequest_disallowed.html"));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(server->TestServerPageW(
+ L"files/sync_xmlhttprequest_disallowed.html")));
// Let's check the XMLHttpRequest ran successfully.
bool success = false;
@@ -132,8 +134,9 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_DuringUnload) {
scoped_refptr<TabProxy> tab(browser_proxy->GetActiveTab());
ASSERT_TRUE(tab.get());
- tab->NavigateToURL(
- server->TestServerPageW(L"files/sync_xmlhttprequest_during_unload.html"));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(server->TestServerPageW(
+ L"files/sync_xmlhttprequest_during_unload.html")));
// Confirm that the page has loaded (since it changes its title during load).
std::wstring tab_title;
@@ -142,7 +145,8 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_DuringUnload) {
// Navigate to a new page, to dispatch unload event and trigger xhr.
// (the bug would make this step hang the renderer).
- tab->NavigateToURL(server->TestServerPageW(L"files/title2.html"));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(server->TestServerPageW(L"files/title2.html")));
// Check that the new page got loaded, and that no download was triggered.
EXPECT_TRUE(tab->GetTabTitle(&tab_title));
@@ -168,7 +172,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteOnunloadCookie) {
ASSERT_TRUE(tab.get());
GURL url(server->TestServerPageW(L"files/onunload_cookie.html"));
- tab->NavigateToURL(url);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url));
// Confirm that the page has loaded (since it changes its title during load).
std::wstring tab_title;
@@ -216,7 +220,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteAfterCrash) {
#if defined(OS_WIN)
expected_crashes_ = 1;
#endif
- tab->NavigateToURLAsync(GURL("about:crash"));
+ ASSERT_TRUE(tab->NavigateToURLAsync(GURL("about:crash")));
// Wait for browser to notice the renderer crash.
PlatformThread::Sleep(sleep_timeout_ms());
@@ -243,7 +247,8 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationNonBuffered) {
// Make sure that the page loads and displays a title, and doesn't get stuck.
FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("title2.html");
- tab->NavigateToURL(net::FilePathToFileURL(test_file));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(net::FilePathToFileURL(test_file)));
EXPECT_EQ(L"Title Of Awesomeness", GetActiveTabTitle());
}
@@ -262,7 +267,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) {
ASSERT_TRUE(tab.get());
GURL url(server->TestServerPageW(L"files/onunload_cookie.html"));
- tab->NavigateToURL(url);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url));
// Confirm that the page has loaded (since it changes its title during load).
std::wstring tab_title;
@@ -273,8 +278,9 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) {
// TODO(creis): If this causes crashes or hangs, it might be for the same
// reason as ErrorPageTest::DNSError. See bug 1199491 and
// http://crbug.com/22877.
- tab->NavigateToURLBlockUntilNavigationsComplete(
- GURL(URLRequestFailedDnsJob::kTestUrl), 2);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURLBlockUntilNavigationsComplete(
+ GURL(URLRequestFailedDnsJob::kTestUrl), 2));
EXPECT_NE(L"set cookie on unload", GetActiveTabTitle());
// Check that the cookie was set, meaning that the onunload handler ran.
@@ -292,7 +298,8 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) {
GURL test_url(server->TestServerPageW(L"files/title2.html"));
std::string redirect_url = "javascript:window.location='" +
test_url.possibly_invalid_spec() + "'";
- tab->NavigateToURL(GURL(redirect_url));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(GURL(redirect_url)));
EXPECT_TRUE(tab->GetTabTitle(&tab_title));
EXPECT_EQ(L"Title Of Awesomeness", tab_title);
}
diff --git a/chrome/browser/sessions/session_restore_uitest.cc b/chrome/browser/sessions/session_restore_uitest.cc
index 966717c..1947521 100644
--- a/chrome/browser/sessions/session_restore_uitest.cc
+++ b/chrome/browser/sessions/session_restore_uitest.cc
@@ -103,7 +103,7 @@ TEST_F(SessionRestoreUITest, Basic) {
ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(action_timeout_ms()));
ASSERT_EQ(url2_, GetActiveTabURL());
- tab_proxy->GoBack();
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab_proxy->GoBack());
ASSERT_EQ(url1_, GetActiveTabURL());
}
@@ -246,11 +246,11 @@ TEST_F(SessionRestoreUITest, ClosedTabStaysClosed) {
scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetTab(0));
ASSERT_TRUE(tab_proxy.get());
- browser_proxy->AppendTab(url2_);
+ ASSERT_TRUE(browser_proxy->AppendTab(url2_));
scoped_refptr<TabProxy> active_tab(browser_proxy->GetActiveTab());
ASSERT_TRUE(active_tab.get());
- active_tab->Close(true);
+ ASSERT_TRUE(active_tab->Close(true));
QuitBrowserAndRestore(1);
browser_proxy = NULL;
@@ -285,7 +285,7 @@ TEST_F(SessionRestoreUITest, NormalAndPopup) {
scoped_refptr<TabProxy> tab(popup->GetTab(0));
ASSERT_TRUE(tab.get());
- tab->NavigateToURL(url1_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url1_));
// Simulate an exit by shuting down the session service. If we don't do this
// the first window close is treated as though the user closed the window
diff --git a/chrome/browser/tab_contents/view_source_uitest.cc b/chrome/browser/tab_contents/view_source_uitest.cc
index 60af8d6..e5d71b7 100644
--- a/chrome/browser/tab_contents/view_source_uitest.cc
+++ b/chrome/browser/tab_contents/view_source_uitest.cc
@@ -47,12 +47,12 @@ TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) {
url = GURL("view-source:" + url.spec());
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_TRUE(tab.get());
- tab->NavigateToURL(url);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url));
// Try to retrieve the cookie that the page sets
// It should not be there (because we are in view-source mode
std::string cookie_found;
- tab->GetCookieByName(url, cookie, &cookie_found);
+ ASSERT_TRUE(tab->GetCookieByName(url, cookie, &cookie_found));
EXPECT_NE(cookie_data, cookie_found);
}
diff --git a/chrome/browser/tab_restore_uitest.cc b/chrome/browser/tab_restore_uitest.cc
index f0725ca..c955eb3 100644
--- a/chrome/browser/tab_restore_uitest.cc
+++ b/chrome/browser/tab_restore_uitest.cc
@@ -102,7 +102,7 @@ class TabRestoreUITest : public UITest {
EXPECT_TRUE(browser->GetTabCount(&starting_tab_count));
for (int i = 0; i < how_many; ++i) {
- browser->AppendTab(url1_);
+ EXPECT_TRUE(browser->AppendTab(url1_));
int current_tab_count;
EXPECT_TRUE(browser->GetTabCount(&current_tab_count));
EXPECT_EQ(starting_tab_count + i + 1, current_tab_count);
@@ -156,9 +156,9 @@ TEST_F(TabRestoreUITest, Basic) {
scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index));
ASSERT_TRUE(new_tab.get());
// Make sure we're at url.
- new_tab->NavigateToURL(url1_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, new_tab->NavigateToURL(url1_));
// Close the tab.
- new_tab->Close(true);
+ ASSERT_TRUE(new_tab->Close(true));
new_tab = NULL;
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
EXPECT_EQ(starting_tab_count, tab_count);
@@ -187,9 +187,9 @@ TEST_F(TabRestoreUITest, MiddleTab) {
scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index));
ASSERT_TRUE(new_tab.get());
// Make sure we're at url.
- new_tab->NavigateToURL(url1_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, new_tab->NavigateToURL(url1_));
// Close the tab.
- new_tab->Close(true);
+ ASSERT_TRUE(new_tab->Close(true));
new_tab = NULL;
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
EXPECT_EQ(starting_tab_count + 2, tab_count);
@@ -224,9 +224,9 @@ TEST_F(TabRestoreUITest, FLAKY_RestoreToDifferentWindow) {
scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index));
ASSERT_TRUE(new_tab.get());
// Make sure we're at url.
- new_tab->NavigateToURL(url1_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, new_tab->NavigateToURL(url1_));
// Close the tab.
- new_tab->Close(true);
+ ASSERT_TRUE(new_tab->Close(true));
new_tab = NULL;
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
EXPECT_EQ(starting_tab_count + 2, tab_count);
@@ -264,15 +264,15 @@ TEST_F(TabRestoreUITest, MAYBE_BasicRestoreFromClosedWindow) {
while (tab_count > 1) {
scoped_refptr<TabProxy> tab_to_close(browser_proxy->GetTab(0));
ASSERT_TRUE(tab_to_close.get());
- tab_to_close->Close(true);
+ ASSERT_TRUE(tab_to_close->Close(true));
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
}
// Navigate to url1 then url2.
scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetTab(0));
ASSERT_TRUE(tab_proxy.get());
- tab_proxy->NavigateToURL(url1_);
- tab_proxy->NavigateToURL(url2_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab_proxy->NavigateToURL(url1_));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab_proxy->NavigateToURL(url2_));
// Create a new browser.
ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, false));
@@ -323,7 +323,7 @@ TEST_F(TabRestoreUITest, DISABLED_DontLoadRestoredTab) {
// Close one of them.
scoped_refptr<TabProxy> tab_to_close(browser_proxy->GetTab(0));
ASSERT_TRUE(tab_to_close.get());
- tab_to_close->Close(true);
+ ASSERT_TRUE(tab_to_close->Close(true));
ASSERT_TRUE(browser_proxy->GetTabCount(&current_tab_count));
ASSERT_EQ(current_tab_count, starting_tab_count + 1);
@@ -358,9 +358,9 @@ TEST_F(TabRestoreUITest, FLAKY_RestoreWindowAndTab) {
scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index));
ASSERT_TRUE(new_tab.get());
// Make sure we're at url.
- new_tab->NavigateToURL(url1_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, new_tab->NavigateToURL(url1_));
// Close the tab.
- new_tab->Close(true);
+ ASSERT_TRUE(new_tab->Close(true));
new_tab = NULL;
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
EXPECT_EQ(starting_tab_count + 2, tab_count);
@@ -413,7 +413,7 @@ TEST_F(TabRestoreUITest, RestoreIntoSameWindow) {
// Navigate the rightmost one to url2_ for easier identification.
scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetTab(tab_count - 1));
ASSERT_TRUE(tab_proxy.get());
- tab_proxy->NavigateToURL(url2_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab_proxy->NavigateToURL(url2_));
// Create a new browser.
ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, false));
@@ -426,7 +426,7 @@ TEST_F(TabRestoreUITest, RestoreIntoSameWindow) {
while (tab_count > 1) {
scoped_refptr<TabProxy> tab_to_close(browser_proxy->GetTab(0));
ASSERT_TRUE(tab_to_close.get());
- tab_to_close->Close(true);
+ ASSERT_TRUE(tab_to_close->Close(true));
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
}
@@ -472,7 +472,7 @@ TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) {
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
// Add a tab
- browser_proxy->AppendTab(http_url1);
+ ASSERT_TRUE(browser_proxy->AppendTab(http_url1));
int new_tab_count;
ASSERT_TRUE(browser_proxy->GetTabCount(&new_tab_count));
EXPECT_EQ(++tab_count, new_tab_count);
@@ -480,16 +480,16 @@ TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) {
ASSERT_TRUE(tab.get());
// Navigate to another same-site URL.
- tab->NavigateToURL(http_url2);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(http_url2));
// Close the tab.
- tab->Close(true);
+ ASSERT_TRUE(tab->Close(true));
tab = NULL;
// Create a new tab to the original site. Assuming process-per-site is
// enabled, this will ensure that the SiteInstance used by the restored tab
// will already exist when the restore happens.
- browser_proxy->AppendTab(http_url2);
+ ASSERT_TRUE(browser_proxy->AppendTab(http_url2));
// Restore the closed tab.
RestoreTab(0, tab_count - 1);
@@ -519,7 +519,7 @@ TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) {
ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count));
// Add a tab
- browser_proxy->AppendTab(http_url1);
+ ASSERT_TRUE(browser_proxy->AppendTab(http_url1));
int new_tab_count;
ASSERT_TRUE(browser_proxy->GetTabCount(&new_tab_count));
EXPECT_EQ(++tab_count, new_tab_count);
@@ -527,18 +527,18 @@ TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) {
ASSERT_TRUE(tab.get());
// Navigate to more URLs, then a cross-site URL.
- tab->NavigateToURL(http_url2);
- tab->NavigateToURL(http_url1);
- tab->NavigateToURL(url1_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(http_url2));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(http_url1));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url1_));
// Close the tab.
- tab->Close(true);
+ ASSERT_TRUE(tab->Close(true));
tab = NULL;
// Create a new tab to the original site. Assuming process-per-site is
// enabled, this will ensure that the SiteInstance will already exist when
// the user clicks Back in the restored tab.
- browser_proxy->AppendTab(http_url2);
+ ASSERT_TRUE(browser_proxy->AppendTab(http_url2));
// Restore the closed tab.
RestoreTab(0, tab_count - 1);
@@ -552,7 +552,7 @@ TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) {
// Navigating to a new URL should clear the forward list, because the max
// page ID of the renderer should have been updated when we restored the tab.
- tab->NavigateToURL(http_url2);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(http_url2));
EXPECT_FALSE(tab->GoForward());
EXPECT_EQ(http_url2, GetActiveTabURL());
}
@@ -571,18 +571,18 @@ TEST_F(TabRestoreUITest, RestoreWindow) {
ASSERT_TRUE(browser_proxy.get());
int initial_tab_count;
ASSERT_TRUE(browser_proxy->GetTabCount(&initial_tab_count));
- browser_proxy->AppendTab(url1_);
+ ASSERT_TRUE(browser_proxy->AppendTab(url1_));
ASSERT_TRUE(browser_proxy->WaitForTabCountToBecome(initial_tab_count + 1,
action_max_timeout_ms()));
scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(initial_tab_count));
ASSERT_TRUE(new_tab.get());
- new_tab->NavigateToURL(url1_);
- browser_proxy->AppendTab(url2_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, new_tab->NavigateToURL(url1_));
+ ASSERT_TRUE(browser_proxy->AppendTab(url2_));
ASSERT_TRUE(browser_proxy->WaitForTabCountToBecome(initial_tab_count + 2,
action_max_timeout_ms()));
new_tab = browser_proxy->GetTab(initial_tab_count + 1);
ASSERT_TRUE(new_tab.get());
- new_tab->NavigateToURL(url2_);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, new_tab->NavigateToURL(url2_));
// Close the window.
ASSERT_TRUE(browser_proxy->RunCommand(IDC_CLOSE_WINDOW));