| 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 "chrome/browser/ui/search/search_ipc_router.h" | 5 #include "chrome/browser/ui/search/search_ipc_router.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" | 9 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" |
| 10 #include "chrome/browser/ui/search/search_tab_helper.h" | 10 #include "chrome/browser/ui/search/search_tab_helper.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 MOCK_METHOD0(ShouldProcessSetVoiceSearchSupport, bool()); | 38 MOCK_METHOD0(ShouldProcessSetVoiceSearchSupport, bool()); |
| 39 MOCK_METHOD0(ShouldSendSetDisplayInstantResults, bool()); | 39 MOCK_METHOD0(ShouldSendSetDisplayInstantResults, bool()); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 class SearchIPCRouterTest : public ChromeRenderViewHostTestHarness { | 44 class SearchIPCRouterTest : public ChromeRenderViewHostTestHarness { |
| 45 public: | 45 public: |
| 46 virtual void SetUp() { | 46 virtual void SetUp() { |
| 47 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 48 switches::kEnableInstantExtendedAPI); | |
| 49 ChromeRenderViewHostTestHarness::SetUp(); | 47 ChromeRenderViewHostTestHarness::SetUp(); |
| 50 SearchTabHelper::CreateForWebContents(web_contents()); | 48 SearchTabHelper::CreateForWebContents(web_contents()); |
| 51 } | 49 } |
| 52 | 50 |
| 53 SearchTabHelper* GetSearchTabHelper( | 51 SearchTabHelper* GetSearchTabHelper( |
| 54 content::WebContents* web_contents) { | 52 content::WebContents* web_contents) { |
| 55 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents); | 53 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents); |
| 56 return SearchTabHelper::FromWebContents(web_contents); | 54 return SearchTabHelper::FromWebContents(web_contents); |
| 57 } | 55 } |
| 58 | 56 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 SetupMockDelegateAndPolicy(web_contents()); | 145 SetupMockDelegateAndPolicy(web_contents()); |
| 148 MockSearchIPCRouterPolicy* policy = | 146 MockSearchIPCRouterPolicy* policy = |
| 149 GetSearchIPCRouterPolicy(web_contents()); | 147 GetSearchIPCRouterPolicy(web_contents()); |
| 150 EXPECT_CALL(*policy, ShouldSendSetDisplayInstantResults()).Times(1) | 148 EXPECT_CALL(*policy, ShouldSendSetDisplayInstantResults()).Times(1) |
| 151 .WillOnce(testing::Return(false)); | 149 .WillOnce(testing::Return(false)); |
| 152 | 150 |
| 153 GetSearchTabHelper(web_contents())->ipc_router().SetDisplayInstantResults(); | 151 GetSearchTabHelper(web_contents())->ipc_router().SetDisplayInstantResults(); |
| 154 ASSERT_FALSE(MessageWasSent( | 152 ASSERT_FALSE(MessageWasSent( |
| 155 ChromeViewMsg_SearchBoxSetDisplayInstantResults::ID)); | 153 ChromeViewMsg_SearchBoxSetDisplayInstantResults::ID)); |
| 156 } | 154 } |
| OLD | NEW |