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

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

Issue 1772763002: Replace base::Tuple in //ppapi with std::tuple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update #include Created 4 years, 9 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') | no next file » | 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <tuple>
8
7 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
8 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
9 #include "ppapi/c/pp_errors.h" 11 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/ppb_var.h" 12 #include "ppapi/c/ppb_var.h"
11 #include "ppapi/c/ppb_websocket.h" 13 #include "ppapi/c/ppb_websocket.h"
12 #include "ppapi/proxy/locking_resource_releaser.h" 14 #include "ppapi/proxy/locking_resource_releaser.h"
13 #include "ppapi/proxy/plugin_message_filter.h" 15 #include "ppapi/proxy/plugin_message_filter.h"
14 #include "ppapi/proxy/ppapi_messages.h" 16 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/proxy/ppapi_proxy_test.h" 17 #include "ppapi/proxy/ppapi_proxy_test.h"
16 #include "ppapi/proxy/websocket_resource.h" 18 #include "ppapi/proxy/websocket_resource.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 MakeCallback()); 75 MakeCallback());
74 ASSERT_EQ(PP_OK_COMPLETIONPENDING, result); 76 ASSERT_EQ(PP_OK_COMPLETIONPENDING, result);
75 77
76 // Should be sent a "Connect" message. 78 // Should be sent a "Connect" message.
77 ResourceMessageCallParams params; 79 ResourceMessageCallParams params;
78 IPC::Message msg; 80 IPC::Message msg;
79 ASSERT_TRUE(sink().GetFirstResourceCallMatching( 81 ASSERT_TRUE(sink().GetFirstResourceCallMatching(
80 PpapiHostMsg_WebSocket_Connect::ID, &params, &msg)); 82 PpapiHostMsg_WebSocket_Connect::ID, &params, &msg));
81 PpapiHostMsg_WebSocket_Connect::Schema::Param p; 83 PpapiHostMsg_WebSocket_Connect::Schema::Param p;
82 PpapiHostMsg_WebSocket_Connect::Read(&msg, &p); 84 PpapiHostMsg_WebSocket_Connect::Read(&msg, &p);
83 EXPECT_EQ(url, base::get<0>(p)); 85 EXPECT_EQ(url, std::get<0>(p));
84 EXPECT_EQ(protocol0, base::get<1>(p)[0]); 86 EXPECT_EQ(protocol0, std::get<1>(p)[0]);
85 EXPECT_EQ(protocol1, base::get<1>(p)[1]); 87 EXPECT_EQ(protocol1, std::get<1>(p)[1]);
86 88
87 // Synthesize a response. 89 // Synthesize a response.
88 ResourceMessageReplyParams reply_params(params.pp_resource(), 90 ResourceMessageReplyParams reply_params(params.pp_resource(),
89 params.sequence()); 91 params.sequence());
90 reply_params.set_result(PP_OK); 92 reply_params.set_result(PP_OK);
91 PluginMessageFilter::DispatchResourceReplyForTest( 93 PluginMessageFilter::DispatchResourceReplyForTest(
92 reply_params, PpapiPluginMsg_WebSocket_ConnectReply(url, protocol1)); 94 reply_params, PpapiPluginMsg_WebSocket_ConnectReply(url, protocol1));
93 95
94 EXPECT_EQ(PP_OK, g_callback_result); 96 EXPECT_EQ(PP_OK, g_callback_result);
95 EXPECT_EQ(true, g_callback_called); 97 EXPECT_EQ(true, g_callback_called);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 error_reply_params.set_result(PP_OK); 161 error_reply_params.set_result(PP_OK);
160 PluginMessageFilter::DispatchResourceReplyForTest( 162 PluginMessageFilter::DispatchResourceReplyForTest(
161 error_reply_params, PpapiPluginMsg_WebSocket_ErrorReply()); 163 error_reply_params, PpapiPluginMsg_WebSocket_ErrorReply());
162 164
163 EXPECT_EQ(PP_ERROR_FAILED, g_callback_result); 165 EXPECT_EQ(PP_ERROR_FAILED, g_callback_result);
164 EXPECT_TRUE(g_callback_called); 166 EXPECT_TRUE(g_callback_called);
165 } 167 }
166 168
167 } // namespace proxy 169 } // namespace proxy
168 } // namespace ppapi 170 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_message_test_sink.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698