| 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_var.h" | 5 #include "ppapi/tests/test_var.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| 11 #include "ppapi/c/dev/ppb_testing_dev.h" | 11 #include "ppapi/c/dev/ppb_testing_dev.h" |
| 12 #include "ppapi/c/pp_var.h" | 12 #include "ppapi/c/pp_var.h" |
| 13 #include "ppapi/c/ppb_var.h" | 13 #include "ppapi/c/ppb_var.h" |
| 14 #include "ppapi/cpp/instance.h" | 14 #include "ppapi/cpp/instance.h" |
| 15 #include "ppapi/cpp/module.h" | 15 #include "ppapi/cpp/module.h" |
| 16 #include "ppapi/cpp/var.h" | 16 #include "ppapi/cpp/var.h" |
| 17 #include "ppapi/tests/testing_instance.h" | 17 #include "ppapi/tests/testing_instance.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 uint32_t kInvalidLength = static_cast<uint32_t>(-1); | 21 uint32_t kInvalidLength = static_cast<uint32_t>(-1); |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 REGISTER_TEST_CASE(Var); | 25 REGISTER_TEST_CASE(Var); |
| 26 | 26 |
| 27 bool TestVar::Init() { | 27 bool TestVar::Init() { |
| 28 var_interface_ = reinterpret_cast<const PPB_Var*>( | 28 var_interface_ = static_cast<const PPB_Var*>( |
| 29 pp::Module::Get()->GetBrowserInterface(PPB_VAR_INTERFACE)); | 29 pp::Module::Get()->GetBrowserInterface(PPB_VAR_INTERFACE)); |
| 30 return var_interface_ && InitTestingInterface(); | 30 return var_interface_ && InitTestingInterface(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void TestVar::RunTests(const std::string& filter) { | 33 void TestVar::RunTests(const std::string& filter) { |
| 34 RUN_TEST(BasicString, filter); | 34 RUN_TEST(BasicString, filter); |
| 35 RUN_TEST(InvalidAndEmpty, filter); | 35 RUN_TEST(InvalidAndEmpty, filter); |
| 36 RUN_TEST(InvalidUtf8, filter); | 36 RUN_TEST(InvalidUtf8, filter); |
| 37 RUN_TEST(NullInputInUtf8Conversion, filter); | 37 RUN_TEST(NullInputInUtf8Conversion, filter); |
| 38 RUN_TEST(ValidUtf8, filter); | 38 RUN_TEST(ValidUtf8, filter); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (length != 0) { | 242 if (length != 0) { |
| 243 return "Expected 0 on string conversion from Double var."; | 243 return "Expected 0 on string conversion from Double var."; |
| 244 } | 244 } |
| 245 if (result != NULL) { | 245 if (result != NULL) { |
| 246 return "Expected NULL on string conversion from Double var."; | 246 return "Expected NULL on string conversion from Double var."; |
| 247 } | 247 } |
| 248 | 248 |
| 249 PASS(); | 249 PASS(); |
| 250 } | 250 } |
| 251 | 251 |
| OLD | NEW |