Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: chrome/browser/ui/browser_browsertest.cc

Issue 2630683003: Revert of Convert more test helpers to base::RunLoop, fix page title checks. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/public/test/browser_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_browsertest.cc
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index f6cf8387db5040b99e4408f6415a58664635f4f5..8fbaf0a6646dfc2650bf02e6c028811465f68f48 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -2386,11 +2386,11 @@
base::FilePath(FILE_PATH_LITERAL("href.html")));
}
- base::string16 GetFirstPageTitle() {
+ base::string16 getFirstPageTitle() {
return ASCIIToUTF16(kFirstPageTitle);
}
- base::string16 GetSecondPageTitle() {
+ base::string16 getSecondPageTitle() {
return ASCIIToUTF16(kSecondPageTitle);
}
@@ -2418,8 +2418,7 @@
same_tab_observer.Wait();
EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile()));
EXPECT_EQ(1, browser->tab_strip_model()->count());
- EXPECT_EQ(GetSecondPageTitle(),
- content::TitleWatcher(web_contents).WaitAndGetTitle());
+ EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle());
return;
}
@@ -2437,15 +2436,13 @@
EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile()));
EXPECT_EQ(2, browser->tab_strip_model()->count());
web_contents = browser->tab_strip_model()->GetActiveWebContents();
- base::string16 expected_title;
+ WaitForLoadStop(web_contents);
if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) {
- expected_title = GetSecondPageTitle();
+ EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle());
} else {
ASSERT_EQ(WindowOpenDisposition::NEW_BACKGROUND_TAB, disposition);
- expected_title = GetFirstPageTitle();
+ EXPECT_EQ(getFirstPageTitle(), web_contents->GetTitle());
}
- EXPECT_EQ(expected_title,
- content::TitleWatcher(web_contents).WaitAndGetTitle());
}
private:
« no previous file with comments | « no previous file | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698