Fix DisownOpener and related tests.
[chromium-blink-merge.git] / ppapi / tests / test_instance_deprecated.h
blobdfccd138938e2b8a8b56519920a78d379fc02bee
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.
5 #ifndef PPAPI_TESTS_TEST_INSTANCE_H_
6 #define PPAPI_TESTS_TEST_INSTANCE_H_
8 #include <string>
9 #include <vector>
11 #include "ppapi/tests/test_case.h"
13 class TestInstance : public TestCase {
14 public:
15 TestInstance(TestingInstance* instance);
16 virtual ~TestInstance();
18 // TestCase implementation.
19 virtual bool Init();
20 virtual void RunTests(const std::string& filter);
22 void set_string(const std::string& s) { string_ = s; }
24 // Leak a reference to the given var, but ignore the leak in the leak checking
25 // that happens at shutdown. This allows us to test the "ForceFree" that
26 // happens on instance shutdown.
27 void LeakReferenceAndIgnore(const pp::Var& leaked);
29 protected:
30 // Test case protected overrides.
31 virtual pp::deprecated::ScriptableObject* CreateTestObject();
33 private:
34 std::string TestExecuteScript();
35 std::string TestRecursiveObjects();
36 std::string TestLeakedObjectDestructors();
37 std::string TestSetupExecuteScriptAtInstanceShutdown();
38 std::string TestExecuteScriptAtInstanceShutdown();
40 // Value written by set_string which is called by the ScriptableObject. This
41 // allows us to keep track of what was called.
42 std::string string_;
45 #endif // PPAPI_TESTS_TEST_INSTANCE_H_