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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 MOCK_METHOD1(OnInstantSupportDetermined, void(bool supports_instant)); | 63 MOCK_METHOD1(OnInstantSupportDetermined, void(bool supports_instant)); |
64 MOCK_METHOD1(FocusOmnibox, void(OmniboxFocusState state)); | 64 MOCK_METHOD1(FocusOmnibox, void(OmniboxFocusState state)); |
65 MOCK_METHOD2(NavigateToURL, void(const GURL&, WindowOpenDisposition)); | 65 MOCK_METHOD2(NavigateToURL, void(const GURL&, WindowOpenDisposition)); |
66 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); | 66 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); |
67 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); | 67 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); |
68 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); | 68 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); |
69 MOCK_METHOD2(OnLogEvent, void(NTPLoggingEventType event, | 69 MOCK_METHOD2(OnLogEvent, void(NTPLoggingEventType event, |
70 base::TimeDelta time)); | 70 base::TimeDelta time)); |
71 MOCK_METHOD2(OnLogMostVisitedImpression, | 71 MOCK_METHOD2(OnLogMostVisitedImpression, |
72 void(int position, const base::string16& provider)); | 72 void(int position, NTPLoggingTileSource tile_source)); |
73 MOCK_METHOD2(OnLogMostVisitedNavigation, | 73 MOCK_METHOD2(OnLogMostVisitedNavigation, |
74 void(int position, const base::string16& provider)); | 74 void(int position, NTPLoggingTileSource tile_source)); |
75 MOCK_METHOD1(PasteIntoOmnibox, void(const base::string16&)); | 75 MOCK_METHOD1(PasteIntoOmnibox, void(const base::string16&)); |
76 MOCK_METHOD1(OnChromeIdentityCheck, void(const base::string16& identity)); | 76 MOCK_METHOD1(OnChromeIdentityCheck, void(const base::string16& identity)); |
77 MOCK_METHOD0(OnHistorySyncCheck, void()); | 77 MOCK_METHOD0(OnHistorySyncCheck, void()); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace | 80 } // namespace |
81 | 81 |
82 class SearchTabHelperTest : public ChromeRenderViewHostTestHarness { | 82 class SearchTabHelperTest : public ChromeRenderViewHostTestHarness { |
83 public: | 83 public: |
84 void SetUp() override { | 84 void SetUp() override { |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 } | 453 } |
454 | 454 |
455 TEST_F(SearchTabHelperPrerenderTest, | 455 TEST_F(SearchTabHelperPrerenderTest, |
456 OnTabActivatedNoPrerenderIfOmniboxBlurred) { | 456 OnTabActivatedNoPrerenderIfOmniboxBlurred) { |
457 SearchTabHelperPrerenderTest::omnibox_has_focus_ = false; | 457 SearchTabHelperPrerenderTest::omnibox_has_focus_ = false; |
458 SearchTabHelper* search_tab_helper = | 458 SearchTabHelper* search_tab_helper = |
459 SearchTabHelper::FromWebContents(web_contents()); | 459 SearchTabHelper::FromWebContents(web_contents()); |
460 search_tab_helper->OnTabActivated(); | 460 search_tab_helper->OnTabActivated(); |
461 ASSERT_FALSE(IsInstantURLMarkedForPrerendering()); | 461 ASSERT_FALSE(IsInstantURLMarkedForPrerendering()); |
462 } | 462 } |
OLD | NEW |