OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram_base.h" | 9 #include "base/metrics/histogram_base.h" |
10 #include "base/metrics/histogram_samples.h" | 10 #include "base/metrics/histogram_samples.h" |
(...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2890 browser()->tab_strip_model()->ActivateTabAt(0, false); | 2890 browser()->tab_strip_model()->ActivateTabAt(0, false); |
2891 | 2891 |
2892 // Switch back to new tab. | 2892 // Switch back to new tab. |
2893 browser()->tab_strip_model()->ActivateTabAt(1, false); | 2893 browser()->tab_strip_model()->ActivateTabAt(1, false); |
2894 | 2894 |
2895 // Confirm that new tab got no onmostvisitedchanged event. | 2895 // Confirm that new tab got no onmostvisitedchanged event. |
2896 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 2896 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
2897 EXPECT_TRUE(UpdateSearchState(active_tab)); | 2897 EXPECT_TRUE(UpdateSearchState(active_tab)); |
2898 EXPECT_EQ(2, on_most_visited_change_calls_); | 2898 EXPECT_EQ(2, on_most_visited_change_calls_); |
2899 } | 2899 } |
2900 | |
2901 // 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
| |
2902 #if defined(OS_LINUX) | |
2903 #define MAYBE_DispatchMVChangeEventWhileNavigatingBackToNTP DispatchMVChangeEven tWhileNavigatingBackToNTP | |
2904 #else | |
2905 #define MAYBE_DispatchMVChangeEventWhileNavigatingBackToNTP DISABLED_DispatchMVC hangeEventWhileNavigatingBackToNTP | |
2906 #endif | |
2907 IN_PROC_BROWSER_TEST_F(InstantExtendedTest, | |
2908 MAYBE_DispatchMVChangeEventWhileNavigatingBackToNTP) { | |
2909 // Setup Instant. | |
2910 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | |
2911 FocusOmniboxAndWaitForInstantOverlayAndNTPSupport(); | |
2912 | |
2913 // Open new tab. Preloaded NTP contents should have been used. | |
2914 ui_test_utils::NavigateToURLWithDisposition( | |
2915 browser(), | |
2916 GURL(chrome::kChromeUINewTabURL), | |
2917 NEW_FOREGROUND_TAB, | |
2918 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | |
2919 | |
2920 content::WebContents* active_tab = | |
2921 browser()->tab_strip_model()->GetActiveWebContents(); | |
2922 EXPECT_TRUE(UpdateSearchState(active_tab)); | |
2923 EXPECT_EQ(2, on_most_visited_change_calls_); | |
2924 | |
2925 content::WindowedNotificationObserver observer( | |
2926 content::NOTIFICATION_LOAD_STOP, | |
2927 content::NotificationService::AllSources()); | |
2928 // Set the text and press enter to navigate from NTP. | |
2929 SetOmniboxText("Pen"); | |
2930 PressEnterAndWaitForNavigation(); | |
2931 EXPECT_EQ(ASCIIToUTF16("Pen"), omnibox()->GetText()); | |
2932 observer.Wait(); | |
2933 | |
2934 // Navigate back to NTP. | |
2935 content::WindowedNotificationObserver back_observer( | |
2936 content::NOTIFICATION_LOAD_STOP, | |
2937 content::NotificationService::AllSources()); | |
2938 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | |
2939 EXPECT_TRUE(active_tab->GetController().CanGoBack()); | |
2940 active_tab->GetController().GoBack(); | |
2941 back_observer.Wait(); | |
2942 | |
2943 // Verify that onmostvisitedchange event is dispatched when we navigate from | |
2944 // SRP to NTP. | |
2945 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | |
2946 EXPECT_TRUE(UpdateSearchState(active_tab)); | |
2947 EXPECT_EQ(2, on_most_visited_change_calls_); | |
2948 } | |
OLD | NEW |