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

Unified Diff: chrome/browser/ui/search/instant_extended_interactive_uitest.cc

Issue 17424004: Added test to verify that onmostvisitedchange event is dispatched when an user navigate from SRP to… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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 | « chrome/browser/ui/search/instant_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_extended_interactive_uitest.cc
diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
index e72634a70a035d5a72795f5dd3c6da710942986e..16e3367cf818f53d86efdfc6187390bfa6ba6f6d 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -1639,3 +1639,52 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, DISABLED_NavigateBackToNTP) {
active_tab = browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_TRUE(chrome::IsInstantNTP(active_tab));
}
+
+// Flaky on Windows and Mac try bots.
+#if defined(OS_CHROMEOS)
+#define MAYBE_DispatchMVChangeEventWhileNavigatingBackToNTP DispatchMVChangeEventWhileNavigatingBackToNTP
+#else
+#define MAYBE_DispatchMVChangeEventWhileNavigatingBackToNTP DISABLED_DispatchMVChangeEventWhileNavigatingBackToNTP
+#endif
+IN_PROC_BROWSER_TEST_F(InstantExtendedTest,
+ MAYBE_DispatchMVChangeEventWhileNavigatingBackToNTP) {
+ // Setup Instant.
+ ASSERT_NO_FATAL_FAILURE(SetupInstant(browser()));
+ FocusOmniboxAndWaitForInstantNTPSupport();
+
+ // Open new tab. Preloaded NTP contents should have been used.
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(),
+ GURL(chrome::kChromeUINewTabURL),
+ NEW_FOREGROUND_TAB,
+ ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
+
+ content::WebContents* active_tab =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_TRUE(UpdateSearchState(active_tab));
+ EXPECT_EQ(1, on_most_visited_change_calls_);
+
+ content::WindowedNotificationObserver observer(
+ content::NOTIFICATION_LOAD_STOP,
+ content::NotificationService::AllSources());
+ // Set the text and press enter to navigate from NTP.
+ SetOmniboxText("Pen");
+ PressEnterAndWaitForNavigation();
+ EXPECT_EQ(ASCIIToUTF16("Pen"), omnibox()->GetText());
+ observer.Wait();
+
+ // Navigate back to NTP.
+ content::WindowedNotificationObserver back_observer(
+ content::NOTIFICATION_LOAD_STOP,
+ content::NotificationService::AllSources());
+ active_tab = browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_TRUE(active_tab->GetController().CanGoBack());
+ active_tab->GetController().GoBack();
+ back_observer.Wait();
+
+ // Verify that onmostvisitedchange event is dispatched when we navigate from
+ // SRP to NTP.
+ active_tab = browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_TRUE(UpdateSearchState(active_tab));
+ EXPECT_EQ(1, on_most_visited_change_calls_);
+}
« no previous file with comments | « chrome/browser/ui/search/instant_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698