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_deprecated.h" | 5 #include "ppapi/tests/test_var_deprecated.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 REGISTER_TEST_CASE(VarDeprecated); | 68 REGISTER_TEST_CASE(VarDeprecated); |
69 | 69 |
70 bool TestVarDeprecated::Init() { | 70 bool TestVarDeprecated::Init() { |
71 var_interface_ = static_cast<const PPB_Var_Deprecated*>( | 71 var_interface_ = static_cast<const PPB_Var_Deprecated*>( |
72 pp::Module::Get()->GetBrowserInterface(PPB_VAR_DEPRECATED_INTERFACE)); | 72 pp::Module::Get()->GetBrowserInterface(PPB_VAR_DEPRECATED_INTERFACE)); |
73 return var_interface_ && InitTestingInterface(); | 73 return var_interface_ && InitTestingInterface(); |
74 } | 74 } |
75 | 75 |
76 void TestVarDeprecated::RunTest() { | 76 void TestVarDeprecated::RunTests(const std::string& filter) { |
77 RUN_TEST(BasicString); | 77 RUN_TEST(BasicString, filter); |
78 RUN_TEST(InvalidAndEmpty); | 78 RUN_TEST(InvalidAndEmpty, filter); |
79 RUN_TEST(InvalidUtf8); | 79 RUN_TEST(InvalidUtf8, filter); |
80 RUN_TEST(NullInputInUtf8Conversion); | 80 RUN_TEST(NullInputInUtf8Conversion, filter); |
81 RUN_TEST(ValidUtf8); | 81 RUN_TEST(ValidUtf8, filter); |
82 RUN_TEST(Utf8WithEmbeddedNulls); | 82 RUN_TEST(Utf8WithEmbeddedNulls, filter); |
83 RUN_TEST(VarToUtf8ForWrongType); | 83 RUN_TEST(VarToUtf8ForWrongType, filter); |
84 RUN_TEST(HasPropertyAndMethod); | 84 RUN_TEST(HasPropertyAndMethod, filter); |
85 RUN_TEST(PassReference); | 85 RUN_TEST(PassReference, filter); |
86 } | 86 } |
87 | 87 |
88 pp::deprecated::ScriptableObject* TestVarDeprecated::CreateTestObject() { | 88 pp::deprecated::ScriptableObject* TestVarDeprecated::CreateTestObject() { |
89 return new VarScriptableObject(this); | 89 return new VarScriptableObject(this); |
90 } | 90 } |
91 | 91 |
92 std::string TestVarDeprecated::TestBasicString() { | 92 std::string TestVarDeprecated::TestBasicString() { |
93 uint32_t before_object = testing_interface_->GetLiveObjectsForInstance( | 93 uint32_t before_object = testing_interface_->GetLiveObjectsForInstance( |
94 instance_->pp_instance()); | 94 instance_->pp_instance()); |
95 { | 95 { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 // this by executing it (it was a function we defined above) and it should | 383 // this by executing it (it was a function we defined above) and it should |
384 // return "works" concatenated with the argument. | 384 // return "works" concatenated with the argument. |
385 pp::VarPrivate function(var_from_page_); | 385 pp::VarPrivate function(var_from_page_); |
386 pp::Var result = var_from_page_.Call(pp::Var(), "nice"); | 386 pp::Var result = var_from_page_.Call(pp::Var(), "nice"); |
387 ASSERT_TRUE(result.is_string()); | 387 ASSERT_TRUE(result.is_string()); |
388 ASSERT_TRUE(result.AsString() == "worksnice"); | 388 ASSERT_TRUE(result.AsString() == "worksnice"); |
389 | 389 |
390 PASS(); | 390 PASS(); |
391 } | 391 } |
392 | 392 |
OLD | NEW |