| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
| 9 #include "ppapi/c/dev/ppb_websocket_dev.h" | 9 #include "ppapi/c/dev/ppb_websocket_dev.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 RUN_TEST(InvalidConnect, filter); | 56 RUN_TEST(InvalidConnect, filter); |
| 57 RUN_TEST(GetURL, filter); | 57 RUN_TEST(GetURL, filter); |
| 58 RUN_TEST(ValidConnect, filter); | 58 RUN_TEST(ValidConnect, filter); |
| 59 RUN_TEST(InvalidClose, filter); | 59 RUN_TEST(InvalidClose, filter); |
| 60 RUN_TEST(ValidClose, filter); | 60 RUN_TEST(ValidClose, filter); |
| 61 RUN_TEST(GetProtocol, filter); | 61 RUN_TEST(GetProtocol, filter); |
| 62 RUN_TEST(TextSendReceive, filter); | 62 RUN_TEST(TextSendReceive, filter); |
| 63 } | 63 } |
| 64 | 64 |
| 65 PP_Var TestWebSocket::CreateVar(const char* string) { | 65 PP_Var TestWebSocket::CreateVar(const char* string) { |
| 66 return var_interface_->VarFromUtf8( | 66 return var_interface_->VarFromUtf8(string, strlen(string)); |
| 67 pp::Module::Get()->pp_module(), string, strlen(string)); | |
| 68 } | 67 } |
| 69 | 68 |
| 70 void TestWebSocket::ReleaseVar(const PP_Var& var) { | 69 void TestWebSocket::ReleaseVar(const PP_Var& var) { |
| 71 var_interface_->Release(var); | 70 var_interface_->Release(var); |
| 72 } | 71 } |
| 73 | 72 |
| 74 bool TestWebSocket::AreEqual(const PP_Var& var, const char* string) { | 73 bool TestWebSocket::AreEqual(const PP_Var& var, const char* string) { |
| 75 if (var.type != PP_VARTYPE_STRING) | 74 if (var.type != PP_VARTYPE_STRING) |
| 76 return false; | 75 return false; |
| 77 uint32_t utf8_length; | 76 uint32_t utf8_length; |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 PASS(); | 372 PASS(); |
| 374 } | 373 } |
| 375 | 374 |
| 376 // TODO(toyoshim): Add tests for GetBufferedAmount(). | 375 // TODO(toyoshim): Add tests for GetBufferedAmount(). |
| 377 // For now, the function doesn't work fine because update callback in WebKit is | 376 // For now, the function doesn't work fine because update callback in WebKit is |
| 378 // not landed yet. | 377 // not landed yet. |
| 379 | 378 |
| 380 // TODO(toyoshim): Add tests for didReceiveMessageError(). | 379 // TODO(toyoshim): Add tests for didReceiveMessageError(). |
| 381 | 380 |
| 382 // TODO(toyoshim): Add other function tests. | 381 // TODO(toyoshim): Add other function tests. |
| OLD | NEW |