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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void TestWebSocket::RunTests(const std::string& filter) { | 48 void TestWebSocket::RunTests(const std::string& filter) { |
49 RUN_TEST(IsWebSocket, filter); | 49 RUN_TEST(IsWebSocket, filter); |
50 RUN_TEST(InvalidConnect, filter); | 50 RUN_TEST(InvalidConnect, filter); |
51 RUN_TEST(GetURL, filter); | 51 RUN_TEST(GetURL, filter); |
52 RUN_TEST(ValidConnect, filter); | 52 RUN_TEST(ValidConnect, filter); |
53 RUN_TEST(GetProtocol, filter); | 53 RUN_TEST(GetProtocol, filter); |
54 RUN_TEST(TextSendReceive, filter); | 54 RUN_TEST(TextSendReceive, filter); |
55 } | 55 } |
56 | 56 |
57 PP_Var TestWebSocket::CreateVar(const char* string) { | 57 PP_Var TestWebSocket::CreateVar(const char* string) { |
58 return var_interface_->VarFromUtf8( | 58 return var_interface_->VarFromUtf8(string, strlen(string)); |
59 pp::Module::Get()->pp_module(), string, strlen(string)); | |
60 } | 59 } |
61 | 60 |
62 void TestWebSocket::ReleaseVar(const PP_Var& var) { | 61 void TestWebSocket::ReleaseVar(const PP_Var& var) { |
63 var_interface_->Release(var); | 62 var_interface_->Release(var); |
64 } | 63 } |
65 | 64 |
66 bool TestWebSocket::AreEqual(const PP_Var& var, const char* string) { | 65 bool TestWebSocket::AreEqual(const PP_Var& var, const char* string) { |
67 if (var.type != PP_VARTYPE_STRING) | 66 if (var.type != PP_VARTYPE_STRING) |
68 return false; | 67 return false; |
69 uint32_t utf8_length; | 68 uint32_t utf8_length; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 PASS(); | 231 PASS(); |
233 } | 232 } |
234 | 233 |
235 // TODO(toyoshim): Add tests for GetBufferedAmount(). | 234 // TODO(toyoshim): Add tests for GetBufferedAmount(). |
236 // For now, the function doesn't work fine because update callback in WebKit is | 235 // For now, the function doesn't work fine because update callback in WebKit is |
237 // not landed yet. | 236 // not landed yet. |
238 | 237 |
239 // TODO(toyoshim): Add tests for didReceiveMessageError(). | 238 // TODO(toyoshim): Add tests for didReceiveMessageError(). |
240 | 239 |
241 // TODO(toyoshim): Add other function tests. | 240 // TODO(toyoshim): Add other function tests. |
OLD | NEW |