Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Side by Side Diff: chrome/browser/ui/search/search_tab_helper_unittest.cc

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/search/search_ipc_router.h" 9 #include "chrome/browser/ui/search/search_ipc_router.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 23 matching lines...) Expand all
34 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url)); 34 MOCK_METHOD1(OnDeleteMostVisitedItem, void(const GURL& url));
35 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url)); 35 MOCK_METHOD1(OnUndoMostVisitedDeletion, void(const GURL& url));
36 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void()); 36 MOCK_METHOD0(OnUndoAllMostVisitedDeletions, void());
37 }; 37 };
38 38
39 } // namespace 39 } // namespace
40 40
41 class SearchTabHelperTest : public ChromeRenderViewHostTestHarness { 41 class SearchTabHelperTest : public ChromeRenderViewHostTestHarness {
42 public: 42 public:
43 virtual void SetUp() { 43 virtual void SetUp() {
44 CommandLine::ForCurrentProcess()->AppendSwitch(
45 switches::kEnableInstantExtendedAPI);
46 ChromeRenderViewHostTestHarness::SetUp(); 44 ChromeRenderViewHostTestHarness::SetUp();
47 SearchTabHelper::CreateForWebContents(web_contents()); 45 SearchTabHelper::CreateForWebContents(web_contents());
48 } 46 }
49 47
50 bool MessageWasSent(uint32 id) { 48 bool MessageWasSent(uint32 id) {
51 return process()->sink().GetFirstMessageMatching(id) != NULL; 49 return process()->sink().GetFirstMessageMatching(id) != NULL;
52 } 50 }
53 51
54 MockSearchIPCRouterDelegate* mock_delegate() { return &delegate_; } 52 MockSearchIPCRouterDelegate* mock_delegate() { return &delegate_; }
55 53
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 EXPECT_CALL(*mock_delegate(), OnInstantSupportDetermined(false)).Times(0); 95 EXPECT_CALL(*mock_delegate(), OnInstantSupportDetermined(false)).Times(0);
98 96
99 SearchTabHelper* search_tab_helper = 97 SearchTabHelper* search_tab_helper =
100 SearchTabHelper::FromWebContents(web_contents()); 98 SearchTabHelper::FromWebContents(web_contents());
101 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper); 99 ASSERT_NE(static_cast<SearchTabHelper*>(NULL), search_tab_helper);
102 search_tab_helper->ipc_router().set_delegate(mock_delegate()); 100 search_tab_helper->ipc_router().set_delegate(mock_delegate());
103 search_tab_helper->DetermineIfPageSupportsInstant(); 101 search_tab_helper->DetermineIfPageSupportsInstant();
104 ASSERT_FALSE(MessageWasSent( 102 ASSERT_FALSE(MessageWasSent(
105 ChromeViewMsg_DetermineIfPageSupportsInstant::ID)); 103 ChromeViewMsg_DetermineIfPageSupportsInstant::ID));
106 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698