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

Side by Side Diff: ppapi/proxy/websocket_resource_unittest.cc

Issue 821453003: Update legacy Tuple-using code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 12 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
« no previous file with comments | « ppapi/proxy/resource_message_test_sink.cc ('k') | printing/pdf_render_settings.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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_var.h" 8 #include "ppapi/c/ppb_var.h"
9 #include "ppapi/c/ppb_websocket.h" 9 #include "ppapi/c/ppb_websocket.h"
10 #include "ppapi/proxy/locking_resource_releaser.h" 10 #include "ppapi/proxy/locking_resource_releaser.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 MakeCallback()); 70 MakeCallback());
71 ASSERT_EQ(PP_OK_COMPLETIONPENDING, result); 71 ASSERT_EQ(PP_OK_COMPLETIONPENDING, result);
72 72
73 // Should be sent a "Connect" message. 73 // Should be sent a "Connect" message.
74 ResourceMessageCallParams params; 74 ResourceMessageCallParams params;
75 IPC::Message msg; 75 IPC::Message msg;
76 ASSERT_TRUE(sink().GetFirstResourceCallMatching( 76 ASSERT_TRUE(sink().GetFirstResourceCallMatching(
77 PpapiHostMsg_WebSocket_Connect::ID, &params, &msg)); 77 PpapiHostMsg_WebSocket_Connect::ID, &params, &msg));
78 PpapiHostMsg_WebSocket_Connect::Schema::Param p; 78 PpapiHostMsg_WebSocket_Connect::Schema::Param p;
79 PpapiHostMsg_WebSocket_Connect::Read(&msg, &p); 79 PpapiHostMsg_WebSocket_Connect::Read(&msg, &p);
80 EXPECT_EQ(url, p.a); 80 EXPECT_EQ(url, get<0>(p));
81 EXPECT_EQ(protocol0, p.b[0]); 81 EXPECT_EQ(protocol0, get<1>(p)[0]);
82 EXPECT_EQ(protocol1, p.b[1]); 82 EXPECT_EQ(protocol1, get<1>(p)[1]);
83 83
84 // Synthesize a response. 84 // Synthesize a response.
85 ResourceMessageReplyParams reply_params(params.pp_resource(), 85 ResourceMessageReplyParams reply_params(params.pp_resource(),
86 params.sequence()); 86 params.sequence());
87 reply_params.set_result(PP_OK); 87 reply_params.set_result(PP_OK);
88 PluginMessageFilter::DispatchResourceReplyForTest( 88 PluginMessageFilter::DispatchResourceReplyForTest(
89 reply_params, PpapiPluginMsg_WebSocket_ConnectReply(url, protocol1)); 89 reply_params, PpapiPluginMsg_WebSocket_ConnectReply(url, protocol1));
90 90
91 EXPECT_EQ(PP_OK, g_callback_result); 91 EXPECT_EQ(PP_OK, g_callback_result);
92 EXPECT_EQ(true, g_callback_called); 92 EXPECT_EQ(true, g_callback_called);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 error_reply_params.set_result(PP_OK); 156 error_reply_params.set_result(PP_OK);
157 PluginMessageFilter::DispatchResourceReplyForTest( 157 PluginMessageFilter::DispatchResourceReplyForTest(
158 error_reply_params, PpapiPluginMsg_WebSocket_ErrorReply()); 158 error_reply_params, PpapiPluginMsg_WebSocket_ErrorReply());
159 159
160 EXPECT_EQ(PP_ERROR_FAILED, g_callback_result); 160 EXPECT_EQ(PP_ERROR_FAILED, g_callback_result);
161 EXPECT_TRUE(g_callback_called); 161 EXPECT_TRUE(g_callback_called);
162 } 162 }
163 163
164 } // namespace proxy 164 } // namespace proxy
165 } // namespace ppapi 165 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_message_test_sink.cc ('k') | printing/pdf_render_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698