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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 bool IsGooglePage(content::WebContents* contents) { | 85 bool IsGooglePage(content::WebContents* contents) { |
86 bool is_google = false; | 86 bool is_google = false; |
87 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) | 87 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) |
88 return false; | 88 return false; |
89 return is_google; | 89 return is_google; |
90 } | 90 } |
91 | 91 |
92 private: | 92 private: |
93 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; | 93 scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; |
94 scoped_ptr<net::ScopedDefaultHostResolverProc> scoped_host_resolver_proc_; | 94 std::unique_ptr<net::ScopedDefaultHostResolverProc> |
95 scoped_ptr<net::NetworkChangeNotifier::DisableForTest> | 95 scoped_host_resolver_proc_; |
| 96 std::unique_ptr<net::NetworkChangeNotifier::DisableForTest> |
96 disable_network_change_notifier_; | 97 disable_network_change_notifier_; |
97 }; | 98 }; |
98 | 99 |
99 IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, MANUAL_SearchesFromFakebox) { | 100 IN_PROC_BROWSER_TEST_F(InstantExtendedManualTest, MANUAL_SearchesFromFakebox) { |
100 set_browser(browser()); | 101 set_browser(browser()); |
101 | 102 |
102 FocusOmnibox(); | 103 FocusOmnibox(); |
103 // Open a new tab page. | 104 // Open a new tab page. |
104 content::WindowedNotificationObserver observer( | 105 content::WindowedNotificationObserver observer( |
105 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 106 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 EXPECT_EQ("test", GetOmniboxText()); | 143 EXPECT_EQ("test", GetOmniboxText()); |
143 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); | 144 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); |
144 | 145 |
145 // Pressing enter should search for [test]. | 146 // Pressing enter should search for [test]. |
146 const base::string16& search_title = | 147 const base::string16& search_title = |
147 base::ASCIIToUTF16("test - Google Search"); | 148 base::ASCIIToUTF16("test - Google Search"); |
148 content::TitleWatcher title_watcher(active_tab, search_title); | 149 content::TitleWatcher title_watcher(active_tab, search_title); |
149 PressEnterAndWaitForNavigation(); | 150 PressEnterAndWaitForNavigation(); |
150 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); | 151 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); |
151 } | 152 } |
OLD | NEW |