| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 MOCK_METHOD0(ShouldSendMostVisitedItems, bool()); | 47 MOCK_METHOD0(ShouldSendMostVisitedItems, bool()); |
| 48 MOCK_METHOD0(ShouldSendThemeBackgroundInfo, bool()); | 48 MOCK_METHOD0(ShouldSendThemeBackgroundInfo, bool()); |
| 49 MOCK_METHOD0(ShouldSubmitQuery, bool()); | 49 MOCK_METHOD0(ShouldSubmitQuery, bool()); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 class SearchIPCRouterTest : public ChromeRenderViewHostTestHarness { | 54 class SearchIPCRouterTest : public ChromeRenderViewHostTestHarness { |
| 55 public: | 55 public: |
| 56 virtual void SetUp() { | 56 virtual void SetUp() { |
| 57 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 58 switches::kEnableInstantExtendedAPI); | |
| 59 ChromeRenderViewHostTestHarness::SetUp(); | 57 ChromeRenderViewHostTestHarness::SetUp(); |
| 60 SearchTabHelper::CreateForWebContents(web_contents()); | 58 SearchTabHelper::CreateForWebContents(web_contents()); |
| 61 } | 59 } |
| 62 | 60 |
| 63 SearchTabHelper* GetSearchTabHelper( | 61 SearchTabHelper* GetSearchTabHelper( |
| 64 content::WebContents* web_contents) { | 62 content::WebContents* web_contents) { |
| 65 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents); | 63 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents); |
| 66 return SearchTabHelper::FromWebContents(web_contents); | 64 return SearchTabHelper::FromWebContents(web_contents); |
| 67 } | 65 } |
| 68 | 66 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 305 |
| 308 SetupMockDelegateAndPolicy(web_contents()); | 306 SetupMockDelegateAndPolicy(web_contents()); |
| 309 MockSearchIPCRouterPolicy* policy = | 307 MockSearchIPCRouterPolicy* policy = |
| 310 GetSearchIPCRouterPolicy(web_contents()); | 308 GetSearchIPCRouterPolicy(web_contents()); |
| 311 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1) | 309 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1) |
| 312 .WillOnce(testing::Return(false)); | 310 .WillOnce(testing::Return(false)); |
| 313 | 311 |
| 314 GetSearchTabHelper(web_contents())->ipc_router().Submit(string16()); | 312 GetSearchTabHelper(web_contents())->ipc_router().Submit(string16()); |
| 315 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSubmit::ID)); | 313 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSubmit::ID)); |
| 316 } | 314 } |
| OLD | NEW |