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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class InstantExtendedManualTest : public InProcessBrowserTest, | 43 class InstantExtendedManualTest : public InProcessBrowserTest, |
44 public InstantTestBase { | 44 public InstantTestBase { |
45 public: | 45 public: |
46 InstantExtendedManualTest() { | 46 InstantExtendedManualTest() { |
47 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); | 47 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); |
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 ~InstantExtendedManualTest() override { |
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 void SetUpOnMainThread() override { | 58 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. |
(...skipping 74 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 |