| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 MOCK_METHOD0(ShouldSendMostVisitedItems, bool()); | 56 MOCK_METHOD0(ShouldSendMostVisitedItems, bool()); |
| 57 MOCK_METHOD0(ShouldSendThemeBackgroundInfo, bool()); | 57 MOCK_METHOD0(ShouldSendThemeBackgroundInfo, bool()); |
| 58 MOCK_METHOD0(ShouldSubmitQuery, bool()); | 58 MOCK_METHOD0(ShouldSubmitQuery, bool()); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace | 61 } // namespace |
| 62 | 62 |
| 63 class SearchIPCRouterTest : public ChromeRenderViewHostTestHarness { | 63 class SearchIPCRouterTest : public ChromeRenderViewHostTestHarness { |
| 64 public: | 64 public: |
| 65 virtual void SetUp() { | 65 virtual void SetUp() { |
| 66 CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 67 switches::kEnableInstantExtendedAPI); | |
| 68 ChromeRenderViewHostTestHarness::SetUp(); | 66 ChromeRenderViewHostTestHarness::SetUp(); |
| 69 SearchTabHelper::CreateForWebContents(web_contents()); | 67 SearchTabHelper::CreateForWebContents(web_contents()); |
| 70 } | 68 } |
| 71 | 69 |
| 72 SearchTabHelper* GetSearchTabHelper( | 70 SearchTabHelper* GetSearchTabHelper( |
| 73 content::WebContents* web_contents) { | 71 content::WebContents* web_contents) { |
| 74 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents); | 72 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents); |
| 75 return SearchTabHelper::FromWebContents(web_contents); | 73 return SearchTabHelper::FromWebContents(web_contents); |
| 76 } | 74 } |
| 77 | 75 |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 503 |
| 506 SetupMockDelegateAndPolicy(web_contents()); | 504 SetupMockDelegateAndPolicy(web_contents()); |
| 507 MockSearchIPCRouterPolicy* policy = | 505 MockSearchIPCRouterPolicy* policy = |
| 508 GetSearchIPCRouterPolicy(web_contents()); | 506 GetSearchIPCRouterPolicy(web_contents()); |
| 509 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1) | 507 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1) |
| 510 .WillOnce(testing::Return(false)); | 508 .WillOnce(testing::Return(false)); |
| 511 | 509 |
| 512 GetSearchTabHelper(web_contents())->ipc_router().Submit(string16()); | 510 GetSearchTabHelper(web_contents())->ipc_router().Submit(string16()); |
| 513 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSubmit::ID)); | 511 EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxSubmit::ID)); |
| 514 } | 512 } |
| OLD | NEW |