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

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: '' 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 c9a66666bec172e9b272fa08090c8b1459b654b3..7ee1dc80f7c66bf50b8ffa1421bf749c7a4c86b6 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -2897,3 +2897,52 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoMostVisitedChangedOnTabSwitch) {
EXPECT_TRUE(UpdateSearchState(active_tab));
EXPECT_EQ(2, on_most_visited_change_calls_);
}
+
+// Flaky on Windows and Mac try bots.
Jered 2013/06/19 22:26:45 What is this actually testing on OS_LINUX? Does th
kmadhusu 2013/06/21 17:34:54 Changed OS_LINUX to OS_CHROMEOS. OS_LINUX includ
+#if defined(OS_LINUX)
+#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()));
+ FocusOmniboxAndWaitForInstantOverlayAndNTPSupport();
+
+ // 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(2, 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(2, 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