Lines Matching refs:ws
44 "ws://www.google.com/invalid#fragment",
45 "ws://www.google.com:65535/invalid_port",
244 std::string rv = "ws://";
305 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
306 if (!ws)
316 ws, url_var, protocols, protocol_count,
322 return ws;
325 void TestWebSocket::Send(int32_t /* result */, PP_Resource ws,
328 websocket_interface_->SendMessage(ws, message_var);
339 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
340 ASSERT_TRUE(ws);
342 result = websocket_interface_->IsWebSocket(ws);
345 core_interface_->ReleaseResource(ws);
351 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
352 ASSERT_TRUE(ws);
354 uint64_t bufferedAmount = websocket_interface_->GetBufferedAmount(ws);
357 uint16_t close_code = websocket_interface_->GetCloseCode(ws);
360 PP_Var close_reason = websocket_interface_->GetCloseReason(ws);
364 PP_Bool close_was_clean = websocket_interface_->GetCloseWasClean(ws);
367 PP_Var extensions = websocket_interface_->GetExtensions(ws);
371 PP_Var protocol = websocket_interface_->GetProtocol(ws);
376 websocket_interface_->GetReadyState(ws);
379 PP_Var url = websocket_interface_->GetURL(ws);
383 core_interface_->ReleaseResource(ws);
391 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
392 ASSERT_TRUE(ws);
396 ws, PP_MakeUndefined(), protocols, 1U,
401 ws, PP_MakeUndefined(), protocols, 1U,
405 core_interface_->ReleaseResource(ws);
409 ws = Connect(kInvalidURLs[i], &result, std::string());
410 ASSERT_TRUE(ws);
413 core_interface_->ReleaseResource(ws);
430 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
431 ASSERT_TRUE(ws);
434 ws, url, bad_protocols, 2U,
437 core_interface_->ReleaseResource(ws);
439 ws = websocket_interface_->Create(instance_->pp_instance());
440 ASSERT_TRUE(ws);
442 ws, url, good_protocols, 2U, PP_BlockUntilComplete());
444 core_interface_->ReleaseResource(ws);
451 core_interface_->ReleaseResource(ws);
459 PP_Resource ws = Connect(kInvalidURLs[i], &result, std::string());
460 ASSERT_TRUE(ws);
461 PP_Var url = websocket_interface_->GetURL(ws);
466 core_interface_->ReleaseResource(ws);
474 PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
475 ASSERT_TRUE(ws);
477 PP_Var extensions = websocket_interface_->GetExtensions(ws);
479 core_interface_->ReleaseResource(ws);
491 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
493 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
496 core_interface_->ReleaseResource(ws);
500 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
501 ASSERT_TRUE(ws);
504 ws, 1U, reason, callback.GetCallback().pp_completion_callback()));
506 ws);
509 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
510 ASSERT_TRUE(ws);
513 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, PP_MakeNull(),
516 core_interface_->ReleaseResource(ws);
519 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
520 ASSERT_TRUE(ws);
524 ws, &receive_message_var,
528 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, PP_MakeNull(),
533 result = websocket_interface_->SendMessage(ws, send_message_var);
540 core_interface_->ReleaseResource(ws);
543 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
544 ASSERT_TRUE(ws);
547 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
552 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
560 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
563 core_interface_->ReleaseResource(ws);
580 PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
581 ASSERT_TRUE(ws);
584 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
588 core_interface_->ReleaseResource(ws);
591 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
592 ASSERT_TRUE(ws);
595 ws, PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED, reason,
599 core_interface_->ReleaseResource(ws);
602 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
603 ASSERT_TRUE(ws);
606 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, PP_MakeUndefined(),
610 core_interface_->ReleaseResource(ws);
615 ws = websocket_interface_->Create(instance_->pp_instance());
619 ws, url, protocols, 0U, callback.GetCallback().pp_completion_callback());
622 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
629 core_interface_->ReleaseResource(ws);
635 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
636 ASSERT_TRUE(ws);
639 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
643 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
648 core_interface_->ReleaseResource(ws);
651 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
652 ASSERT_TRUE(ws);
656 ws, &receive_message_var,
660 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
667 core_interface_->ReleaseResource(ws);
670 ws = Connect(GetFullURL(kEchoServerURL), &result, std::string());
671 ASSERT_TRUE(ws);
674 ws, &receive_message_var,
678 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, PP_MakeUndefined(),
685 core_interface_->ReleaseResource(ws);
688 ws = Connect(
690 ASSERT_TRUE(ws);
695 result = websocket_interface_->SendMessage(ws, close_request_var);
698 ws, &receive_message_var,
701 core_interface_->ReleaseResource(ws);
718 PP_Resource ws = Connect(url.c_str(), &result, expected_protocols[i]);
719 ASSERT_TRUE(ws);
722 PP_Var protocol = websocket_interface_->GetProtocol(ws);
726 core_interface_->ReleaseResource(ws);
735 PP_Resource ws =
737 ASSERT_TRUE(ws);
743 int32_t result = websocket_interface_->SendMessage(ws, message_var);
751 ws, &received_message, callback.GetCallback().pp_completion_callback()));
755 core_interface_->ReleaseResource(ws);
764 PP_Resource ws =
766 ASSERT_TRUE(ws);
772 ws, std::string("hello")));
775 ws, std::string("Goodbye")));
782 ws, &received_message, callback.GetCallback().pp_completion_callback());
790 websocket_interface_->GetReadyState(ws);
805 core_interface_->ReleaseResource(ws);
812 PP_Resource ws =
814 ASSERT_TRUE(ws);
822 int32_t result = websocket_interface_->SendMessage(ws, message_var);
830 ws, &received_message, callback.GetCallback().pp_completion_callback()));
834 core_interface_->ReleaseResource(ws);
842 PP_Resource ws =
844 ASSERT_TRUE(ws);
867 result = websocket_interface_->SendMessage(ws, text_var);
869 result = websocket_interface_->SendMessage(ws, binary_var);
872 result = websocket_interface_->SendMessage(ws, large_binary_var);
883 ws, &received_message,
895 core_interface_->ReleaseResource(ws);
903 PP_Resource ws =
905 ASSERT_TRUE(ws);
916 result = websocket_interface_->SendMessage(ws, message_var);
918 buffered_amount = websocket_interface_->GetBufferedAmount(ws);
929 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason,
933 websocket_interface_->GetReadyState(ws));
938 websocket_interface_->GetReadyState(ws));
940 uint64_t base_buffered_amount = websocket_interface_->GetBufferedAmount(ws);
945 result = websocket_interface_->SendMessage(ws, empty_string);
947 buffered_amount = websocket_interface_->GetBufferedAmount(ws);
951 result = websocket_interface_->SendMessage(ws, reason);
953 buffered_amount = websocket_interface_->GetBufferedAmount(ws);
960 core_interface_->ReleaseResource(ws);
972 PP_Resource ws = websocket_interface_->Create(instance_->pp_instance());
973 ASSERT_TRUE(ws);
979 ws, url_var, NULL, 0,
982 core_interface_->ReleaseResource(ws);
987 ws = Connect(url, &result, std::string());
988 ASSERT_TRUE(ws);
994 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, reason_var,
997 core_interface_->ReleaseResource(ws);
1004 ws = Connect(url, &result, std::string());
1005 ASSERT_TRUE(ws);
1011 ws, &receive_var,
1014 core_interface_->ReleaseResource(ws);
1020 ws = Connect(url, &result, std::string());
1021 ASSERT_TRUE(ws);
1024 ws, &receive_var,
1027 ReleaseResourceDelegate receive_delegate(core_interface_, ws);
1030 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, PP_MakeUndefined(),
1054 PP_Resource ws = Connect(url, &result, std::string());
1055 ASSERT_TRUE(ws);
1057 result = websocket_interface_->SendMessage(ws, large_var);
1059 core_interface_->ReleaseResource(ws);
1069 PP_Resource ws = Connect(url, &result, std::string());
1070 ASSERT_TRUE(ws);
1075 ws, PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, PP_MakeUndefined(),
1077 ReleaseResourceDelegate close_delegate(core_interface_, ws);
1095 PP_Resource ws;
1102 ws = Connect(url, &result, std::string());
1103 ASSERT_TRUE(ws);
1106 result = websocket_interface_->SendMessage(ws, text_var);
1113 ws, &var, callback.GetCallback().pp_completion_callback()));
1119 ws, &var, callback.GetCallback().pp_completion_callback());
1120 core_interface_->ReleaseResource(ws);
1128 ws = Connect(url, &result, std::string());
1129 ASSERT_TRUE(ws);
1133 result = websocket_interface_->SendMessage(ws, large_var);
1135 result = websocket_interface_->SendMessage(ws, text_var);
1142 ws, &var, callback.GetCallback().pp_completion_callback()));
1148 ws, &var, callback.GetCallback().pp_completion_callback());
1149 core_interface_->ReleaseResource(ws);
1192 pp::WebSocket ws(instance_);
1195 ASSERT_EQ(0, ws.GetBufferedAmount());
1196 ASSERT_EQ(0, ws.GetCloseCode());
1197 ASSERT_TRUE(AreEqualWithString(ws.GetCloseReason().pp_var(), std::string()));
1198 ASSERT_FALSE(ws.GetCloseWasClean());
1199 ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), std::string()));
1200 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), std::string()));
1201 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID, ws.GetReadyState());
1202 ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), std::string()));
1207 connect_callback.WaitForResult(ws.Connect(
1214 int32_t result = ws.SendMessage(pp::Var(text_message));
1220 result = ws.SendMessage(
1228 ws.ReceiveMessage(&text_receive_var,
1238 ws.ReceiveMessage(&binary_receive_var,
1246 close_callback.WaitForResult(ws.Close(
1253 ASSERT_EQ(0, ws.GetBufferedAmount());
1254 ASSERT_EQ(PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE, ws.GetCloseCode());
1256 AreEqualWithString(ws.GetCloseReason().pp_var(), reason.c_str()));
1257 ASSERT_EQ(true, ws.GetCloseWasClean());
1258 ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), std::string()));
1259 ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED, ws.GetReadyState());
1261 ws.GetURL().pp_var(), GetFullURL(kCloseServerURL).c_str()));
1279 TestWebSocketAPI ws(instance_);
1280 result = ws.Connect(pp::Var(std::string(kInvalidURLs[i])), protocols, 0U);
1282 ws.WaitForClosed();
1283 const std::vector<WebSocketEvent>& events = ws.GetSeenEvents();
1286 ASSERT_EQ(2U, ws.GetSeenEvents().size());
1289 ASSERT_EQ(0U, ws.GetSeenEvents().size());