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

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

Issue 9193013: WebSocket Pepper API: SetBinaryType() returned unexpected PP_FALSE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review 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 | « no previous file | webkit/plugins/ppapi/ppb_websocket_impl.cc » ('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 "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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 ASSERT_EQ(0, ws.GetBufferedAmount()); 565 ASSERT_EQ(0, ws.GetBufferedAmount());
566 ASSERT_EQ(0, ws.GetCloseCode()); 566 ASSERT_EQ(0, ws.GetCloseCode());
567 ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), "")); 567 ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), ""));
568 ASSERT_EQ(false, ws.GetCloseWasClean()); 568 ASSERT_EQ(false, ws.GetCloseWasClean());
569 ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), "")); 569 ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), ""));
570 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), "")); 570 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), ""));
571 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID_DEV, ws.GetReadyState()); 571 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID_DEV, ws.GetReadyState());
572 ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), "")); 572 ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), ""));
573 573
574 // Check communication interfaces (connect, send, receive, and close). 574 // Check communication interfaces (connect, send, receive, and close).
575 ws.SetBinaryType(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV); 575 ASSERT_TRUE(ws.SetBinaryType(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV));
576 TestCompletionCallback connect_callback(instance_->pp_instance()); 576 TestCompletionCallback connect_callback(instance_->pp_instance());
577 int32_t result = ws.Connect(pp::Var(std::string(kCloseServerURL)), NULL, 0U, 577 int32_t result = ws.Connect(pp::Var(std::string(kCloseServerURL)), NULL, 0U,
578 connect_callback); 578 connect_callback);
579 ASSERT_EQ(PP_OK_COMPLETIONPENDING, result); 579 ASSERT_EQ(PP_OK_COMPLETIONPENDING, result);
580 result = connect_callback.WaitForResult(); 580 result = connect_callback.WaitForResult();
581 ASSERT_EQ(PP_OK, result); 581 ASSERT_EQ(PP_OK, result);
582 582
583 std::string text_message("hello C++"); 583 std::string text_message("hello C++");
584 result = ws.SendMessage(pp::Var(text_message)); 584 result = ws.SendMessage(pp::Var(text_message));
585 ASSERT_EQ(PP_OK, result); 585 ASSERT_EQ(PP_OK, result);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), reason.c_str())); 623 ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), reason.c_str()));
624 ASSERT_EQ(true, ws.GetCloseWasClean()); 624 ASSERT_EQ(true, ws.GetCloseWasClean());
625 ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), "")); 625 ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), ""));
626 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), "")); 626 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), ""));
627 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED_DEV, ws.GetReadyState()); 627 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED_DEV, ws.GetReadyState());
628 ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), kCloseServerURL)); 628 ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), kCloseServerURL));
629 ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV, ws.GetBinaryType()); 629 ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV, ws.GetBinaryType());
630 630
631 PASS(); 631 PASS();
632 } 632 }
OLDNEW
« no previous file with comments | « no previous file | webkit/plugins/ppapi/ppb_websocket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698