1// Copyright (c) 2012 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. 4 5#ifndef PPAPI_TEST_TEST_VAR_H_ 6#define PPAPI_TEST_TEST_VAR_H_ 7 8#include <string> 9 10#include "ppapi/c/ppb_var.h" 11#include "ppapi/cpp/var.h" 12#include "ppapi/tests/test_case.h" 13 14class TestVar : public TestCase { 15 public: 16 explicit TestVar(TestingInstance* instance) : TestCase(instance) {} 17 18 private: 19 // TestCase implementation. 20 virtual bool Init(); 21 virtual void RunTests(const std::string& filter); 22 23 std::string TestBasicString(); 24 std::string TestInvalidAndEmpty(); 25 std::string TestInvalidUtf8(); 26 std::string TestNullInputInUtf8Conversion(); 27 std::string TestValidUtf8(); 28 std::string TestUtf8WithEmbeddedNulls(); 29 std::string TestVarToUtf8ForWrongType(); 30 std::string TestHasPropertyAndMethod(); 31 32 // Used by the tests that access the C API directly. 33 const PPB_Var* var_interface_; 34}; 35 36#endif // PPAPI_TEST_TEST_VAR_H_ 37