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

Side by Side Diff: content/public/test/mock_render_thread.cc

Issue 102593002: Convert string16 to base::string16 in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/public/test/mock_render_thread.h ('k') | content/public/test/render_view_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/mock_render_thread.h" 5 #include "content/public/test/mock_render_thread.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "content/common/view_messages.h" 8 #include "content/common/view_messages.h"
9 #include "content/public/renderer/render_process_observer.h" 9 #include "content/public/renderer/render_process_observer.h"
10 #include "ipc/ipc_message_utils.h" 10 #include "ipc/ipc_message_utils.h"
11 #include "ipc/ipc_sync_message.h" 11 #include "ipc/ipc_sync_message.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "third_party/WebKit/public/web/WebScriptController.h" 13 #include "third_party/WebKit/public/web/WebScriptController.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 MockRenderThread::MockRenderThread() 17 MockRenderThread::MockRenderThread()
18 : routing_id_(0), 18 : routing_id_(0),
19 surface_id_(0), 19 surface_id_(0),
20 opener_id_(0), 20 opener_id_(0),
21 new_window_routing_id_(0), 21 new_window_routing_id_(0),
22 new_window_main_frame_routing_id_(0) { 22 new_window_main_frame_routing_id_(0) {
23 } 23 }
24 24
25 MockRenderThread::~MockRenderThread() { 25 MockRenderThread::~MockRenderThread() {
26 } 26 }
27 27
28 void MockRenderThread::VerifyRunJavaScriptMessageSend( 28 void MockRenderThread::VerifyRunJavaScriptMessageSend(
29 const string16& expected_alert_message) { 29 const base::string16& expected_alert_message) {
30 const IPC::Message* alert_msg = 30 const IPC::Message* alert_msg =
31 sink_.GetUniqueMessageMatching(ViewHostMsg_RunJavaScriptMessage::ID); 31 sink_.GetUniqueMessageMatching(ViewHostMsg_RunJavaScriptMessage::ID);
32 ASSERT_TRUE(alert_msg); 32 ASSERT_TRUE(alert_msg);
33 PickleIterator iter = IPC::SyncMessage::GetDataIterator(alert_msg); 33 PickleIterator iter = IPC::SyncMessage::GetDataIterator(alert_msg);
34 ViewHostMsg_RunJavaScriptMessage::SendParam alert_param; 34 ViewHostMsg_RunJavaScriptMessage::SendParam alert_param;
35 ASSERT_TRUE(IPC::ReadParam(alert_msg, &iter, &alert_param)); 35 ASSERT_TRUE(IPC::ReadParam(alert_msg, &iter, &alert_param));
36 EXPECT_EQ(expected_alert_message, alert_param.a); 36 EXPECT_EQ(expected_alert_message, alert_param.a);
37 } 37 }
38 38
39 // Called by the Widget. Used to send messages to the browser. 39 // Called by the Widget. Used to send messages to the browser.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 void MockRenderThread::OnDuplicateSection( 256 void MockRenderThread::OnDuplicateSection(
257 base::SharedMemoryHandle renderer_handle, 257 base::SharedMemoryHandle renderer_handle,
258 base::SharedMemoryHandle* browser_handle) { 258 base::SharedMemoryHandle* browser_handle) {
259 // We don't have to duplicate the input handles since RenderViewTest does not 259 // We don't have to duplicate the input handles since RenderViewTest does not
260 // separate a browser process from a renderer process. 260 // separate a browser process from a renderer process.
261 *browser_handle = renderer_handle; 261 *browser_handle = renderer_handle;
262 } 262 }
263 #endif // defined(OS_WIN) 263 #endif // defined(OS_WIN)
264 264
265 } // namespace content 265 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/mock_render_thread.h ('k') | content/public/test/render_view_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698