Index: ppapi/tests/test_websocket.cc |
diff --git a/ppapi/tests/test_websocket.cc b/ppapi/tests/test_websocket.cc |
index c0073eb24949590eeb6f9e6b319ed47099e7d202..01c90360ce48ddc02bb2ce731ababb3462f03e1c 100644 |
--- a/ppapi/tests/test_websocket.cc |
+++ b/ppapi/tests/test_websocket.cc |
@@ -9,15 +9,15 @@ |
#include "ppapi/c/dev/ppb_testing_dev.h" |
#include "ppapi/c/dev/ppb_var_array_buffer_dev.h" |
-#include "ppapi/c/dev/ppb_websocket_dev.h" |
#include "ppapi/c/pp_errors.h" |
#include "ppapi/c/pp_var.h" |
#include "ppapi/c/pp_completion_callback.h" |
#include "ppapi/c/ppb_core.h" |
#include "ppapi/c/ppb_var.h" |
-#include "ppapi/cpp/dev/websocket_dev.h" |
+#include "ppapi/c/ppb_websocket.h" |
#include "ppapi/cpp/instance.h" |
#include "ppapi/cpp/module.h" |
+#include "ppapi/cpp/websocket.h" |
#include "ppapi/tests/test_utils.h" |
#include "ppapi/tests/testing_instance.h" |
@@ -49,8 +49,8 @@ const uint64_t kMessageFrameOverhead = 6; |
REGISTER_TEST_CASE(WebSocket); |
bool TestWebSocket::Init() { |
- websocket_interface_ = static_cast<const PPB_WebSocket_Dev*>( |
- pp::Module::Get()->GetBrowserInterface(PPB_WEBSOCKET_DEV_INTERFACE)); |
+ websocket_interface_ = static_cast<const PPB_WebSocket*>( |
+ pp::Module::Get()->GetBrowserInterface(PPB_WEBSOCKET_INTERFACE)); |
var_interface_ = static_cast<const PPB_Var*>( |
pp::Module::Get()->GetBrowserInterface(PPB_VAR_INTERFACE)); |
arraybuffer_interface_ = static_cast<const PPB_VarArrayBuffer_Dev*>( |
@@ -133,8 +133,6 @@ PP_Resource TestWebSocket::Connect( |
protocols[0] = CreateVarString(protocol); |
protocol_count = 1U; |
} |
- websocket_interface_->SetBinaryType( |
- ws, PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV); |
*result = websocket_interface_->Connect( |
ws, url_var, protocols, protocol_count, |
static_cast<pp::CompletionCallback>(callback).pp_completion_callback()); |
@@ -189,18 +187,14 @@ std::string TestWebSocket::TestUninitializedPropertiesAccess() { |
ASSERT_TRUE(AreEqualWithString(protocol, "")); |
ReleaseVar(protocol); |
- PP_WebSocketReadyState_Dev ready_state = |
+ PP_WebSocketReadyState ready_state = |
websocket_interface_->GetReadyState(ws); |
- ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID_DEV, ready_state); |
+ ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID, ready_state); |
PP_Var url = websocket_interface_->GetURL(ws); |
ASSERT_TRUE(AreEqualWithString(url, "")); |
ReleaseVar(url); |
- PP_WebSocketBinaryType_Dev binary_type = |
- websocket_interface_->GetBinaryType(ws); |
- ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_BLOB_DEV, binary_type); |
- |
core_interface_->ReleaseResource(ws); |
PASS(); |
@@ -523,12 +517,12 @@ std::string TestWebSocket::TestBufferedAmount() { |
result = websocket_interface_->Close(ws, kCloseCodeNormalClosure, reason, |
static_cast<pp::CompletionCallback>(callback).pp_completion_callback()); |
ASSERT_EQ(PP_OK_COMPLETIONPENDING, result); |
- ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSING_DEV, |
+ ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSING, |
websocket_interface_->GetReadyState(ws)); |
result = callback.WaitForResult(); |
ASSERT_EQ(PP_OK, result); |
- ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED_DEV, |
+ ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED, |
websocket_interface_->GetReadyState(ws)); |
uint64_t base_buffered_amount = websocket_interface_->GetBufferedAmount(ws); |
@@ -559,7 +553,7 @@ std::string TestWebSocket::TestBufferedAmount() { |
std::string TestWebSocket::TestCcInterfaces() { |
// C++ bindings is simple straightforward, then just verifies interfaces work |
// as a interface bridge fine. |
- pp::WebSocket_Dev ws(instance_); |
+ pp::WebSocket ws(instance_); |
// Check uninitialized properties access. |
ASSERT_EQ(0, ws.GetBufferedAmount()); |
@@ -568,11 +562,10 @@ std::string TestWebSocket::TestCcInterfaces() { |
ASSERT_EQ(false, ws.GetCloseWasClean()); |
ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), "")); |
ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), "")); |
- ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID_DEV, ws.GetReadyState()); |
+ ASSERT_EQ(PP_WEBSOCKETREADYSTATE_INVALID, ws.GetReadyState()); |
ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), "")); |
// Check communication interfaces (connect, send, receive, and close). |
- ASSERT_TRUE(ws.SetBinaryType(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV)); |
TestCompletionCallback connect_callback(instance_->pp_instance()); |
int32_t result = ws.Connect(pp::Var(std::string(kCloseServerURL)), NULL, 0U, |
connect_callback); |
@@ -624,9 +617,8 @@ std::string TestWebSocket::TestCcInterfaces() { |
ASSERT_EQ(true, ws.GetCloseWasClean()); |
ASSERT_TRUE(AreEqualWithString(ws.GetExtensions().pp_var(), "")); |
ASSERT_TRUE(AreEqualWithString(ws.GetProtocol().pp_var(), "")); |
- ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED_DEV, ws.GetReadyState()); |
+ ASSERT_EQ(PP_WEBSOCKETREADYSTATE_CLOSED, ws.GetReadyState()); |
ASSERT_TRUE(AreEqualWithString(ws.GetURL().pp_var(), kCloseServerURL)); |
- ASSERT_EQ(PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV, ws.GetBinaryType()); |
PASS(); |
} |