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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/search/instant_service.h" | 9 #include "chrome/browser/search/instant_service.h" |
10 #include "chrome/browser/search/instant_service_factory.h" | 10 #include "chrome/browser/search/instant_service_factory.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Make IsOffline() return false so we don't try to use the local NTP. | 65 // Make IsOffline() return false so we don't try to use the local NTP. |
66 disable_network_change_notifier_.reset( | 66 disable_network_change_notifier_.reset( |
67 new net::NetworkChangeNotifier::DisableForTest()); | 67 new net::NetworkChangeNotifier::DisableForTest()); |
68 } | 68 } |
69 | 69 |
70 void TearDownOnMainThread() override { | 70 void TearDownOnMainThread() override { |
71 disable_network_change_notifier_.reset(); | 71 disable_network_change_notifier_.reset(); |
72 } | 72 } |
73 | 73 |
74 protected: | 74 protected: |
75 void SetUpInProcessBrowserTestFixture() override { | |
76 search::EnableQueryExtractionForTesting(); | |
77 } | |
78 | |
79 content::WebContents* active_tab() { | 75 content::WebContents* active_tab() { |
80 return browser()->tab_strip_model()->GetActiveWebContents(); | 76 return browser()->tab_strip_model()->GetActiveWebContents(); |
81 } | 77 } |
82 | 78 |
83 bool IsGooglePage(content::WebContents* contents) { | 79 bool IsGooglePage(content::WebContents* contents) { |
84 bool is_google = false; | 80 bool is_google = false; |
85 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) | 81 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) |
86 return false; | 82 return false; |
87 return is_google; | 83 return is_google; |
88 } | 84 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 EXPECT_EQ("test", GetOmniboxText()); | 137 EXPECT_EQ("test", GetOmniboxText()); |
142 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); | 138 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); |
143 | 139 |
144 // Pressing enter should search for [test]. | 140 // Pressing enter should search for [test]. |
145 const base::string16& search_title = | 141 const base::string16& search_title = |
146 base::ASCIIToUTF16("test - Google Search"); | 142 base::ASCIIToUTF16("test - Google Search"); |
147 content::TitleWatcher title_watcher(active_tab, search_title); | 143 content::TitleWatcher title_watcher(active_tab, search_title); |
148 PressEnterAndWaitForNavigation(); | 144 PressEnterAndWaitForNavigation(); |
149 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); | 145 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); |
150 } | 146 } |
OLD | NEW |