WebKit roll 98705:98715
[chromium-blink-merge.git] / ppapi / tests / test_var_deprecated.h
blob8e64ece12bd7995fa3388d8fc2e3478c2972a8eb
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
3 // found in the LICENSE file.
5 #ifndef PPAPI_TEST_TEST_VAR_DEPRECATED_H_
6 #define PPAPI_TEST_TEST_VAR_DEPRECATED_H_
8 #include <string>
10 #include "ppapi/cpp/private/var_private.h"
11 #include "ppapi/tests/test_case.h"
13 struct PPB_Var_Deprecated;
15 class TestVarDeprecated : public TestCase {
16 public:
17 explicit TestVarDeprecated(TestingInstance* instance) : TestCase(instance) {}
19 // TestCase implementation.
20 virtual bool Init();
21 virtual void RunTest();
23 void set_var_from_page(const pp::VarPrivate& v) { var_from_page_ = v; }
25 protected:
26 // Test case protected overrides.
27 virtual pp::deprecated::ScriptableObject* CreateTestObject();
29 private:
30 std::string TestBasicString();
31 std::string TestInvalidAndEmpty();
32 std::string TestInvalidUtf8();
33 std::string TestNullInputInUtf8Conversion();
34 std::string TestValidUtf8();
35 std::string TestUtf8WithEmbeddedNulls();
36 std::string TestVarToUtf8ForWrongType();
37 std::string TestHasPropertyAndMethod();
38 std::string TestPassReference();
40 // Used by the tests that access the C API directly.
41 const PPB_Var_Deprecated* var_interface_;
43 // Saves the var from when a value is set on the test from the page.
44 pp::VarPrivate var_from_page_;
47 #endif // PPAPI_TEST_TEST_VAR_DEPRECATED_H_