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

Side by Side Diff: ppapi/tests/test_websocket.cc

Issue 9227008: WebSocket Pepper API: SRPC proxy implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase because two ppapi_proxy related CLs are landed Created 8 years, 11 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
« no previous file with comments | « ppapi/ppapi_sources.gypi ('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 "ppapi/tests/test_websocket.h" 5 #include "ppapi/tests/test_websocket.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ppapi/c/dev/ppb_testing_dev.h" 10 #include "ppapi/c/dev/ppb_testing_dev.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 CreateVarString("x-test"), 242 CreateVarString("x-test"),
243 CreateVarString("x-test") 243 CreateVarString("x-test")
244 }; 244 };
245 PP_Var good_protocols[] = { 245 PP_Var good_protocols[] = {
246 CreateVarString("x-test"), 246 CreateVarString("x-test"),
247 CreateVarString("x-yatest") 247 CreateVarString("x-yatest")
248 }; 248 };
249 249
250 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance()); 250 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
251 ASSERT_TRUE(ws); 251 ASSERT_TRUE(ws);
252 TestCompletionCallback callback(instance_->pp_instance(), force_async_);
252 int32_t result = websocket_interface_->Connect( 253 int32_t result = websocket_interface_->Connect(
253 ws, url, bad_protocols, 2U, PP_BlockUntilComplete()); 254 ws, url, bad_protocols, 2U,
255 static_cast<pp::CompletionCallback>(callback).pp_completion_callback());
256 if (result == PP_OK_COMPLETIONPENDING)
257 result = callback.WaitForResult();
254 ASSERT_EQ(PP_ERROR_BADARGUMENT, result); 258 ASSERT_EQ(PP_ERROR_BADARGUMENT, result);
255 core_interface_->ReleaseResource(ws); 259 core_interface_->ReleaseResource(ws);
256 260
257 ws = websocket_interface_->Create(instance_->pp_instance()); 261 ws = websocket_interface_->Create(instance_->pp_instance());
258 ASSERT_TRUE(ws); 262 ASSERT_TRUE(ws);
259 result = websocket_interface_->Connect( 263 result = websocket_interface_->Connect(
260 ws, url, good_protocols, 2U, PP_BlockUntilComplete()); 264 ws, url, good_protocols, 2U, PP_BlockUntilComplete());
261 ASSERT_EQ(PP_ERROR_BLOCKS_MAIN_THREAD, result); 265 ASSERT_EQ(PP_ERROR_BLOCKS_MAIN_THREAD, result);
262 core_interface_->ReleaseResource(ws); 266 core_interface_->ReleaseResource(ws);
263 267
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), reason.c_str())); 623 ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), reason.c_str()));
620 ASSERT_EQ(true, ws.GetCloseWasClean()); 624 ASSERT_EQ(true, ws.GetCloseWasClean());
621 ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), "")); 625 ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), ""));
622 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), "")); 626 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), ""));
623 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED_DEV, ws.GetReadyState()); 627 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED_DEV, ws.GetReadyState());
624 ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), kCloseServerURL)); 628 ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), kCloseServerURL));
625 ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV, ws.GetBinaryType()); 629 ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV, ws.GetBinaryType());
626 630
627 PASS(); 631 PASS();
628 } 632 }
OLDNEW
« no previous file with comments | « ppapi/ppapi_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698