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

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

Issue 2635933003: Convert more test helpers to base::RunLoop, fix page title checks. (Reland) (Closed)
Patch Set: Fix ClickModifierTests. 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 7f6fa033d5c58ddc9102abb1a97b718c9ba352ba..3974f164cb6ffc6d271fcafac8a25f501b1e102e 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -2389,11 +2389,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);
}
@@ -2421,15 +2421,14 @@ 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(), web_contents->GetTitle());
return;
}
- content::WindowedNotificationObserver observer(
- chrome::NOTIFICATION_TAB_ADDED,
- content::NotificationService::AllSources());
+ content::TestNavigationObserver new_tab_observer(nullptr);
+ new_tab_observer.StartWatchingNewWebContents();
SimulateMouseClick(web_contents, modifiers, button);
- observer.Wait();
+ new_tab_observer.Wait();
if (disposition == WindowOpenDisposition::NEW_WINDOW) {
EXPECT_EQ(2u, chrome::GetBrowserCount(browser->profile()));
@@ -2439,12 +2438,11 @@ 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);
if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) {
- EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle());
+ EXPECT_EQ(GetSecondPageTitle(), web_contents->GetTitle());
} else {
ASSERT_EQ(WindowOpenDisposition::NEW_BACKGROUND_TAB, disposition);
- EXPECT_EQ(getFirstPageTitle(), web_contents->GetTitle());
+ EXPECT_EQ(GetFirstPageTitle(), web_contents->GetTitle());
}
}
« 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