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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 using testing::_; | 46 using testing::_; |
47 using testing::Return; | 47 using testing::Return; |
48 | 48 |
49 namespace { | 49 namespace { |
50 | 50 |
51 class MockSearchIPCRouterDelegate : public SearchIPCRouter::Delegate { | 51 class MockSearchIPCRouterDelegate : public SearchIPCRouter::Delegate { |
52 public: | 52 public: |
53 virtual ~MockSearchIPCRouterDelegate() {} | 53 virtual ~MockSearchIPCRouterDelegate() {} |
54 | 54 |
55 MOCK_METHOD1(OnInstantSupportDetermined, void(bool supports_instant)); | |
56 MOCK_METHOD1(FocusOmnibox, void(OmniboxFocusState state)); | 55 MOCK_METHOD1(FocusOmnibox, void(OmniboxFocusState state)); |
57 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); | 56 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); |
58 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); | 57 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); |
59 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); | 58 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); |
60 MOCK_METHOD2(OnLogEvent, void(NTPLoggingEventType event, | 59 MOCK_METHOD2(OnLogEvent, void(NTPLoggingEventType event, |
61 base::TimeDelta time)); | 60 base::TimeDelta time)); |
62 MOCK_METHOD3(OnLogMostVisitedImpression, | 61 MOCK_METHOD3(OnLogMostVisitedImpression, |
63 void(int position, | 62 void(int position, |
64 ntp_tiles::TileSource tile_source, | 63 ntp_tiles::TileSource tile_source, |
65 ntp_tiles::TileVisualType tile_type)); | 64 ntp_tiles::TileVisualType tile_type)); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 | 607 |
609 TEST_F(SearchIPCRouterTest, DoNotSendSubmitMsg) { | 608 TEST_F(SearchIPCRouterTest, DoNotSendSubmitMsg) { |
610 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); | 609 NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); |
611 SetupMockDelegateAndPolicy(); | 610 SetupMockDelegateAndPolicy(); |
612 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); | 611 MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); |
613 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1).WillOnce(Return(false)); | 612 EXPECT_CALL(*policy, ShouldSubmitQuery()).Times(1).WillOnce(Return(false)); |
614 | 613 |
615 EXPECT_CALL(*mock_search_box(), Submit(_, _)).Times(0); | 614 EXPECT_CALL(*mock_search_box(), Submit(_, _)).Times(0); |
616 GetSearchIPCRouter().Submit(base::string16(), EmbeddedSearchRequestParams()); | 615 GetSearchIPCRouter().Submit(base::string16(), EmbeddedSearchRequestParams()); |
617 } | 616 } |
OLD | NEW |