Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: ppapi/tests/test_instance_deprecated.h

Issue 459553003: Replace NPObject usage in ppapi with gin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef PPAPI_TESTS_TEST_INSTANCE_H_ 5 #ifndef PPAPI_TESTS_TEST_INSTANCE_H_
6 #define PPAPI_TESTS_TEST_INSTANCE_H_ 6 #define PPAPI_TESTS_TEST_INSTANCE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ppapi/tests/test_case.h" 11 #include "ppapi/tests/test_case.h"
12 12
13 class TestInstance : public TestCase { 13 class TestInstance : public TestCase {
14 public: 14 public:
15 TestInstance(TestingInstance* instance); 15 TestInstance(TestingInstance* instance);
16 virtual ~TestInstance(); 16 virtual ~TestInstance();
17 17
18 // TestCase implementation. 18 // TestCase implementation.
19 virtual bool Init(); 19 virtual bool Init();
20 virtual void RunTests(const std::string& filter); 20 virtual void RunTests(const std::string& filter);
21 21
22 void set_string(const std::string& s) { string_ = s; } 22 void set_string(const std::string& s) { string_ = s; }
23 23
24
24 // Leak a reference to the given var, but ignore the leak in the leak checking 25 // 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 // that happens at shutdown. This allows us to test the "ForceFree" that
26 // happens on instance shutdown. 27 // happens on instance shutdown.
27 void LeakReferenceAndIgnore(const pp::Var& leaked); 28 void LeakReferenceAndIgnore(const pp::Var& leaked);
28 29
30 void set_instance_object_destroyed(bool destroyed) {
31 instance_object_destroyed_ = destroyed;
32 }
33
29 protected: 34 protected:
30 // Test case protected overrides. 35 // Test case protected overrides.
31 virtual pp::deprecated::ScriptableObject* CreateTestObject(); 36 virtual pp::deprecated::ScriptableObject* CreateTestObject();
32 37
33 private: 38 private:
34 std::string TestExecuteScript(); 39 std::string TestExecuteScript();
35 std::string TestRecursiveObjects(); 40 std::string TestRecursiveObjects();
36 std::string TestLeakedObjectDestructors(); 41 std::string TestLeakedObjectDestructors();
37 std::string TestSetupExecuteScriptAtInstanceShutdown(); 42 std::string TestSetupExecuteScriptAtInstanceShutdown();
38 std::string TestExecuteScriptAtInstanceShutdown(); 43 std::string TestExecuteScriptAtInstanceShutdown();
39 44
40 // Value written by set_string which is called by the ScriptableObject. This 45 // Value written by set_string which is called by the ScriptableObject. This
41 // allows us to keep track of what was called. 46 // allows us to keep track of what was called.
42 std::string string_; 47 std::string string_;
48
49 // Whether the instance object for this instance has been destroyed.
50 bool instance_object_destroyed_;
43 }; 51 };
44 52
45 #endif // PPAPI_TESTS_TEST_INSTANCE_H_ 53 #endif // PPAPI_TESTS_TEST_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698