| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual void SetUpOnMainThread() OVERRIDE { | 58 virtual void SetUpOnMainThread() OVERRIDE { |
| 59 const testing::TestInfo* const test_info = | 59 const testing::TestInfo* const test_info = |
| 60 testing::UnitTest::GetInstance()->current_test_info(); | 60 testing::UnitTest::GetInstance()->current_test_info(); |
| 61 ASSERT_TRUE(StartsWithASCII(test_info->name(), "MANUAL_", true) || | 61 ASSERT_TRUE(StartsWithASCII(test_info->name(), "MANUAL_", true) || |
| 62 StartsWithASCII(test_info->name(), "DISABLED_", true)); | 62 StartsWithASCII(test_info->name(), "DISABLED_", true)); |
| 63 // Make IsOffline() return false so we don't try to use the local NTP. | 63 // Make IsOffline() return false so we don't try to use the local NTP. |
| 64 disable_network_change_notifier_.reset( | 64 disable_network_change_notifier_.reset( |
| 65 new net::NetworkChangeNotifier::DisableForTest()); | 65 new net::NetworkChangeNotifier::DisableForTest()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 virtual void CleanUpOnMainThread() OVERRIDE { | 68 virtual void TearDownOnMainThread() OVERRIDE { |
| 69 disable_network_change_notifier_.reset(); | 69 disable_network_change_notifier_.reset(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 protected: | 72 protected: |
| 73 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 73 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 74 chrome::EnableQueryExtractionForTesting(); | 74 chrome::EnableQueryExtractionForTesting(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 content::WebContents* active_tab() { | 77 content::WebContents* active_tab() { |
| 78 return browser()->tab_strip_model()->GetActiveWebContents(); | 78 return browser()->tab_strip_model()->GetActiveWebContents(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 EXPECT_EQ("test", GetOmniboxText()); | 138 EXPECT_EQ("test", GetOmniboxText()); |
| 139 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); | 139 EXPECT_EQ(OMNIBOX_FOCUS_VISIBLE, omnibox()->model()->focus_state()); |
| 140 | 140 |
| 141 // Pressing enter should search for [test]. | 141 // Pressing enter should search for [test]. |
| 142 const base::string16& search_title = | 142 const base::string16& search_title = |
| 143 base::ASCIIToUTF16("test - Google Search"); | 143 base::ASCIIToUTF16("test - Google Search"); |
| 144 content::TitleWatcher title_watcher(active_tab, search_title); | 144 content::TitleWatcher title_watcher(active_tab, search_title); |
| 145 PressEnterAndWaitForNavigation(); | 145 PressEnterAndWaitForNavigation(); |
| 146 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); | 146 EXPECT_EQ(search_title, title_watcher.WaitAndGetTitle()); |
| 147 } | 147 } |
| OLD | NEW |