| 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_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 using testing::Eq; | 45 using testing::Eq; |
| 46 using testing::Return; | 46 using testing::Return; |
| 47 using testing::_; | 47 using testing::_; |
| 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_METHOD2(NavigateToURL, void(const GURL&, WindowOpenDisposition)); | |
| 58 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); | 56 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); |
| 59 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); | 57 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); |
| 60 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); | 58 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); |
| 61 MOCK_METHOD2(OnLogEvent, void(NTPLoggingEventType event, | 59 MOCK_METHOD2(OnLogEvent, void(NTPLoggingEventType event, |
| 62 base::TimeDelta time)); | 60 base::TimeDelta time)); |
| 63 MOCK_METHOD3(OnLogMostVisitedImpression, | 61 MOCK_METHOD3(OnLogMostVisitedImpression, |
| 64 void(int position, | 62 void(int position, |
| 65 ntp_tiles::TileSource tile_source, | 63 ntp_tiles::TileSource tile_source, |
| 66 ntp_tiles::TileVisualType tile_type)); | 64 ntp_tiles::TileVisualType tile_type)); |
| 67 MOCK_METHOD3(OnLogMostVisitedNavigation, | 65 MOCK_METHOD3(OnLogMostVisitedNavigation, |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 }; | 255 }; |
| 258 | 256 |
| 259 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) { | 257 TEST_F(SearchTabHelperTest, TitleIsSetForNTP) { |
| 260 TabTitleObserver title_observer(web_contents()); | 258 TabTitleObserver title_observer(web_contents()); |
| 261 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL)); | 259 NavigateAndCommit(GURL(chrome::kChromeUINewTabURL)); |
| 262 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); | 260 const base::string16 title = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); |
| 263 EXPECT_EQ(title, title_observer.title_on_start()); | 261 EXPECT_EQ(title, title_observer.title_on_start()); |
| 264 EXPECT_EQ(title, title_observer.title_on_commit()); | 262 EXPECT_EQ(title, title_observer.title_on_commit()); |
| 265 EXPECT_EQ(title, web_contents()->GetTitle()); | 263 EXPECT_EQ(title, web_contents()->GetTitle()); |
| 266 } | 264 } |
| OLD | NEW |