| 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/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
| 9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 | 802 |
| 803 // Verify that onmostvisitedchange event is dispatched when we navigate from | 803 // Verify that onmostvisitedchange event is dispatched when we navigate from |
| 804 // SRP to NTP. | 804 // SRP to NTP. |
| 805 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 805 active_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 806 EXPECT_TRUE(UpdateSearchState(active_tab)); | 806 EXPECT_TRUE(UpdateSearchState(active_tab)); |
| 807 EXPECT_EQ(1, on_most_visited_change_calls_); | 807 EXPECT_EQ(1, on_most_visited_change_calls_); |
| 808 } | 808 } |
| 809 | 809 |
| 810 // http://crbug.com/518106 | 810 // http://crbug.com/518106 |
| 811 #if defined(OS_WIN) | 811 #if defined(OS_WIN) |
| 812 #define MAYBE_SetPrefetchQuery DISABLED_SetPrefetchQuery | 812 #define MAYBE_SetPrefetchQuery SetPrefetchQuery |
| 813 #else | 813 #else |
| 814 #define MAYBE_SetPrefetchQuery SetPrefetchQuery | 814 #define MAYBE_SetPrefetchQuery SetPrefetchQuery |
| 815 #endif | 815 #endif |
| 816 IN_PROC_BROWSER_TEST_F(InstantExtendedPrefetchTest, MAYBE_SetPrefetchQuery) { | 816 IN_PROC_BROWSER_TEST_F(InstantExtendedPrefetchTest, MAYBE_SetPrefetchQuery) { |
| 817 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 817 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 818 FocusOmnibox(); | 818 FocusOmnibox(); |
| 819 | 819 |
| 820 content::WindowedNotificationObserver new_tab_observer( | 820 content::WindowedNotificationObserver new_tab_observer( |
| 821 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 821 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 822 content::NotificationService::AllSources()); | 822 content::NotificationService::AllSources()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 content::WebContents* active_tab = | 870 content::WebContents* active_tab = |
| 871 browser()->tab_strip_model()->GetActiveWebContents(); | 871 browser()->tab_strip_model()->GetActiveWebContents(); |
| 872 ASSERT_TRUE(UpdateSearchState(active_tab)); | 872 ASSERT_TRUE(UpdateSearchState(active_tab)); |
| 873 ASSERT_TRUE(SearchProvider::ShouldPrefetch(*( | 873 ASSERT_TRUE(SearchProvider::ShouldPrefetch(*( |
| 874 omnibox()->model()->result().default_match()))); | 874 omnibox()->model()->result().default_match()))); |
| 875 ASSERT_EQ("puppy", prefetch_query_value_); | 875 ASSERT_EQ("puppy", prefetch_query_value_); |
| 876 } | 876 } |
| 877 | 877 |
| 878 // http://crbug.com/518106 | 878 // http://crbug.com/518106 |
| 879 #if defined(OS_WIN) | 879 #if defined(OS_WIN) |
| 880 #define MAYBE_ClearPrefetchedResults DISABLED_ClearPrefetchedResults | 880 #define MAYBE_ClearPrefetchedResults ClearPrefetchedResults |
| 881 #else | 881 #else |
| 882 #define MAYBE_ClearPrefetchedResults ClearPrefetchedResults | 882 #define MAYBE_ClearPrefetchedResults ClearPrefetchedResults |
| 883 #endif | 883 #endif |
| 884 IN_PROC_BROWSER_TEST_F(InstantExtendedPrefetchTest, | 884 IN_PROC_BROWSER_TEST_F(InstantExtendedPrefetchTest, |
| 885 MAYBE_ClearPrefetchedResults) { | 885 MAYBE_ClearPrefetchedResults) { |
| 886 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); | 886 ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); |
| 887 FocusOmnibox(); | 887 FocusOmnibox(); |
| 888 | 888 |
| 889 content::WindowedNotificationObserver new_tab_observer( | 889 content::WindowedNotificationObserver new_tab_observer( |
| 890 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 890 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 stream << "link.href = \"" << result_url.spec() << "\";"; | 995 stream << "link.href = \"" << result_url.spec() << "\";"; |
| 996 stream << "document.body.appendChild(link);"; | 996 stream << "document.body.appendChild(link);"; |
| 997 stream << "link.click();"; | 997 stream << "link.click();"; |
| 998 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); | 998 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); |
| 999 | 999 |
| 1000 content::WaitForLoadStop(contents); | 1000 content::WaitForLoadStop(contents); |
| 1001 std::string expected_title = | 1001 std::string expected_title = |
| 1002 "Referrer is " + instant_url().GetWithEmptyPath().spec(); | 1002 "Referrer is " + instant_url().GetWithEmptyPath().spec(); |
| 1003 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); | 1003 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); |
| 1004 } | 1004 } |
| OLD | NEW |