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

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

Issue 2527133002: Remove some WebContents::GetRenderViewHost() calls. (Closed)
Patch Set: More reverts for the same reason as patch set 3, fixes merge conflict Created 4 years 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
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_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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 template_url_service->SetUserSelectedDefaultSearchProvider(template_url); 115 template_url_service->SetUserSelectedDefaultSearchProvider(template_url);
116 process()->sink().ClearMessages(); 116 process()->sink().ClearMessages();
117 } 117 }
118 118
119 content::WebContents* web_contents() { 119 content::WebContents* web_contents() {
120 return browser()->tab_strip_model()->GetActiveWebContents(); 120 return browser()->tab_strip_model()->GetActiveWebContents();
121 } 121 }
122 122
123 content::MockRenderProcessHost* process() { 123 content::MockRenderProcessHost* process() {
124 return static_cast<content::MockRenderProcessHost*>( 124 return static_cast<content::MockRenderProcessHost*>(
125 web_contents()->GetRenderViewHost()->GetProcess()); 125 web_contents()->GetMainFrame()->GetProcess());
126 } 126 }
127 127
128 SearchTabHelper* GetSearchTabHelper( 128 SearchTabHelper* GetSearchTabHelper(
129 content::WebContents* web_contents) { 129 content::WebContents* web_contents) {
130 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents); 130 EXPECT_NE(static_cast<content::WebContents*>(NULL), web_contents);
131 return SearchTabHelper::FromWebContents(web_contents); 131 return SearchTabHelper::FromWebContents(web_contents);
132 } 132 }
133 133
134 void SetupMockDelegateAndPolicy() { 134 void SetupMockDelegateAndPolicy() {
135 content::WebContents* contents = web_contents(); 135 content::WebContents* contents = web_contents();
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 711
712 // Construct a series of synthetic messages for each valid IPC message type, 712 // Construct a series of synthetic messages for each valid IPC message type,
713 // ensuring the router ignores them all. 713 // ensuring the router ignores them all.
714 for (int i = 0; i < LastIPCMsgStart; ++i) { 714 for (int i = 0; i < LastIPCMsgStart; ++i) {
715 const int message_id = i << 16; 715 const int message_id = i << 16;
716 ASSERT_EQ(IPC_MESSAGE_ID_CLASS(message_id), i); 716 ASSERT_EQ(IPC_MESSAGE_ID_CLASS(message_id), i);
717 IPC::Message msg(routing_id, message_id, IPC::Message::PRIORITY_LOW); 717 IPC::Message msg(routing_id, message_id, IPC::Message::PRIORITY_LOW);
718 EXPECT_FALSE(OnSpuriousMessageReceived(msg)) << i; 718 EXPECT_FALSE(OnSpuriousMessageReceived(msg)) << i;
719 } 719 }
720 } 720 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698