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