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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 host_resolver_proc_->AllowDirectLookup("*"); | 48 host_resolver_proc_->AllowDirectLookup("*"); |
49 scoped_host_resolver_proc_.reset( | 49 scoped_host_resolver_proc_.reset( |
50 new net::ScopedDefaultHostResolverProc(host_resolver_proc_.get())); | 50 new net::ScopedDefaultHostResolverProc(host_resolver_proc_.get())); |
51 } | 51 } |
52 | 52 |
53 virtual ~InstantExtendedManualTest() { | 53 virtual ~InstantExtendedManualTest() { |
54 scoped_host_resolver_proc_.reset(); | 54 scoped_host_resolver_proc_.reset(); |
55 host_resolver_proc_ = NULL; | 55 host_resolver_proc_ = NULL; |
56 } | 56 } |
57 | 57 |
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 TearDownOnMainThread() 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(); |
79 } | 79 } |
80 | 80 |
81 bool IsGooglePage(content::WebContents* contents) { | 81 bool IsGooglePage(content::WebContents* contents) { |
82 bool is_google = false; | 82 bool is_google = false; |
83 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) | 83 if (!GetBoolFromJS(contents, "!!window.google", &is_google)) |
(...skipping 54 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 |