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 #ifndef PPAPI_TEST_TEST_VAR_DEPRECATED_H_ | 5 #ifndef PPAPI_TEST_TEST_VAR_DEPRECATED_H_ |
6 #define PPAPI_TEST_TEST_VAR_DEPRECATED_H_ | 6 #define PPAPI_TEST_TEST_VAR_DEPRECATED_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ppapi/cpp/private/var_private.h" | 10 #include "ppapi/cpp/private/var_private.h" |
11 #include "ppapi/tests/test_case.h" | 11 #include "ppapi/tests/test_case.h" |
12 | 12 |
13 struct PPB_Var_Deprecated; | 13 struct PPB_Var_Deprecated; |
14 | 14 |
15 class TestVarDeprecated : public TestCase { | 15 class TestVarDeprecated : public TestCase { |
16 public: | 16 public: |
17 explicit TestVarDeprecated(TestingInstance* instance) : TestCase(instance) {} | 17 explicit TestVarDeprecated(TestingInstance* instance) : TestCase(instance) {} |
18 | 18 |
19 // TestCase implementation. | 19 // TestCase implementation. |
20 virtual bool Init(); | 20 virtual bool Init(); |
21 virtual void RunTest(); | 21 virtual void RunTests(const std::string& filter); |
22 | 22 |
23 void set_var_from_page(const pp::VarPrivate& v) { var_from_page_ = v; } | 23 void set_var_from_page(const pp::VarPrivate& v) { var_from_page_ = v; } |
24 | 24 |
25 protected: | 25 protected: |
26 // Test case protected overrides. | 26 // Test case protected overrides. |
27 virtual pp::deprecated::ScriptableObject* CreateTestObject(); | 27 virtual pp::deprecated::ScriptableObject* CreateTestObject(); |
28 | 28 |
29 private: | 29 private: |
30 std::string TestBasicString(); | 30 std::string TestBasicString(); |
31 std::string TestInvalidAndEmpty(); | 31 std::string TestInvalidAndEmpty(); |
32 std::string TestInvalidUtf8(); | 32 std::string TestInvalidUtf8(); |
33 std::string TestNullInputInUtf8Conversion(); | 33 std::string TestNullInputInUtf8Conversion(); |
34 std::string TestValidUtf8(); | 34 std::string TestValidUtf8(); |
35 std::string TestUtf8WithEmbeddedNulls(); | 35 std::string TestUtf8WithEmbeddedNulls(); |
36 std::string TestVarToUtf8ForWrongType(); | 36 std::string TestVarToUtf8ForWrongType(); |
37 std::string TestHasPropertyAndMethod(); | 37 std::string TestHasPropertyAndMethod(); |
38 std::string TestPassReference(); | 38 std::string TestPassReference(); |
39 | 39 |
40 // Used by the tests that access the C API directly. | 40 // Used by the tests that access the C API directly. |
41 const PPB_Var_Deprecated* var_interface_; | 41 const PPB_Var_Deprecated* var_interface_; |
42 | 42 |
43 // Saves the var from when a value is set on the test from the page. | 43 // Saves the var from when a value is set on the test from the page. |
44 pp::VarPrivate var_from_page_; | 44 pp::VarPrivate var_from_page_; |
45 }; | 45 }; |
46 | 46 |
47 #endif // PPAPI_TEST_TEST_VAR_DEPRECATED_H_ | 47 #endif // PPAPI_TEST_TEST_VAR_DEPRECATED_H_ |
48 | 48 |
OLD | NEW |