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

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

Issue 2601843002: Convert more test helpers to base::RunLoop, fix page title checks. (Closed)
Patch Set: Remove unneeded call. 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 8fbaf0a6646dfc2650bf02e6c028811465f68f48..f6cf8387db5040b99e4408f6415a58664635f4f5 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -2386,11 +2386,11 @@ class ClickModifierTest : public InProcessBrowserTest {
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,7 +2418,8 @@ class ClickModifierTest : public InProcessBrowserTest {
same_tab_observer.Wait();
EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile()));
EXPECT_EQ(1, browser->tab_strip_model()->count());
- EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle());
+ EXPECT_EQ(GetSecondPageTitle(),
+ content::TitleWatcher(web_contents).WaitAndGetTitle());
return;
}
@@ -2436,13 +2437,15 @@ class ClickModifierTest : public InProcessBrowserTest {
EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile()));
EXPECT_EQ(2, browser->tab_strip_model()->count());
web_contents = browser->tab_strip_model()->GetActiveWebContents();
- WaitForLoadStop(web_contents);
+ base::string16 expected_title;
if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) {
- EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle());
+ expected_title = GetSecondPageTitle();
} else {
ASSERT_EQ(WindowOpenDisposition::NEW_BACKGROUND_TAB, disposition);
- EXPECT_EQ(getFirstPageTitle(), web_contents->GetTitle());
+ expected_title = GetFirstPageTitle();
}
Peter Kasting 2017/01/12 18:16:17 Nit: The preceding lines could optionally be writt
Alexander Semashko 2017/01/12 20:48:19 To me the current code is much more clear, I'd lea
+ 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