| 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 "base/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
| 6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
| 7 #include "chrome/browser/search/instant_service.h" | 7 #include "chrome/browser/search/instant_service.h" |
| 8 #include "chrome/browser/search/instant_service_factory.h" | 8 #include "chrome/browser/search/instant_service_factory.h" |
| 9 #include "chrome/browser/search/search.h" | 9 #include "chrome/browser/search/search.h" |
| 10 #include "chrome/browser/task_manager/task_manager.h" | 10 #include "chrome/browser/task_manager/task_manager.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 disable_network_change_notifier_.reset( | 65 disable_network_change_notifier_.reset( |
| 66 new net::NetworkChangeNotifier::DisableForTest()); | 66 new net::NetworkChangeNotifier::DisableForTest()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual void CleanUpOnMainThread() OVERRIDE { | 69 virtual void CleanUpOnMainThread() OVERRIDE { |
| 70 disable_network_change_notifier_.reset(); | 70 disable_network_change_notifier_.reset(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 74 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 75 chrome::EnableInstantExtendedAPIForTesting(); | 75 chrome::EnableQueryExtractionForTesting(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 content::WebContents* active_tab() { | 78 content::WebContents* active_tab() { |
| 79 return browser()->tab_strip_model()->GetActiveWebContents(); | 79 return browser()->tab_strip_model()->GetActiveWebContents(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool IsGooglePage(content::WebContents* contents) { | 82 bool IsGooglePage(content::WebContents* contents) { |
| 83 bool is_google = false; | 83 bool is_google = false; |
| 84 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) | 84 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) |
| 85 return false; | 85 return false; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // The omnibox should say "test" and have visible focus. | 164 // The omnibox should say "test" and have visible focus. |
| 165 EXPECT_EQ("test", GetOmniboxText()); | 165 EXPECT_EQ("test", GetOmniboxText()); |
| 166 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); | 166 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); |
| 167 | 167 |
| 168 // Pressing enter should search for [test]. | 168 // Pressing enter should search for [test]. |
| 169 const string16& search_title = ASCIIToUTF16("test - Google Search"); | 169 const string16& search_title = ASCIIToUTF16("test - Google Search"); |
| 170 content::TitleWatcher title_watcher(active_tab, search_title); | 170 content::TitleWatcher title_watcher(active_tab, search_title); |
| 171 PressEnterAndWaitForNavigation(); | 171 PressEnterAndWaitForNavigation(); |
| 172 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); | 172 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); |
| 173 } | 173 } |
| OLD | NEW |