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

Side by Side Diff: o3d/gpu_plugin/np_utils/np_object_mock.h

Issue 196032: Replaced BaseNPObject with DefaultNPObject because...... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 O3D_GPU_PLUGIN_NP_UTILS_BASE_NP_OBJECT_MOCK_H_ 5 #ifndef O3D_GPU_PLUGIN_NP_UTILS_NP_OBJECT_MOCK_H_
6 #define O3D_GPU_PLUGIN_NP_UTILS_BASE_NP_OBJECT_MOCK_H_ 6 #define O3D_GPU_PLUGIN_NP_UTILS_NP_OBJECT_MOCK_H_
7 7
8 #include "o3d/gpu_plugin/np_utils/base_np_object.h" 8 #include "third_party/npapi/bindings/npapi.h"
9 #include "third_party/npapi/bindings/npruntime.h"
9 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
10 11
11 namespace o3d { 12 namespace o3d {
12 namespace gpu_plugin { 13 namespace gpu_plugin {
13 14
14 class MockBaseNPObject : public BaseNPObject { 15 class MockNPObject : public NPObject {
15 public: 16 public:
16 explicit MockBaseNPObject(NPP npp) : BaseNPObject(npp) { 17 explicit MockNPObject(NPP npp) {
17 ++count_;
18 }
19
20 ~MockBaseNPObject() {
21 --count_;
22 }
23
24 static int count() {
25 return count_;
26 } 18 }
27 19
28 MOCK_METHOD0(Invalidate, void()); 20 MOCK_METHOD0(Invalidate, void());
29 MOCK_METHOD1(HasMethod, bool(NPIdentifier)); 21 MOCK_METHOD1(HasMethod, bool(NPIdentifier));
30 MOCK_METHOD4(Invoke, 22 MOCK_METHOD4(Invoke,
31 bool(NPIdentifier, const NPVariant*, uint32_t, NPVariant*)); 23 bool(NPIdentifier, const NPVariant*, uint32_t, NPVariant*));
32 MOCK_METHOD3(InvokeDefault, bool(const NPVariant*, uint32_t, NPVariant*)); 24 MOCK_METHOD3(InvokeDefault, bool(const NPVariant*, uint32_t, NPVariant*));
33 MOCK_METHOD1(HasProperty, bool(NPIdentifier)); 25 MOCK_METHOD1(HasProperty, bool(NPIdentifier));
34 MOCK_METHOD2(GetProperty, bool(NPIdentifier, NPVariant*)); 26 MOCK_METHOD2(GetProperty, bool(NPIdentifier, NPVariant*));
35 MOCK_METHOD2(SetProperty, bool(NPIdentifier, const NPVariant*)); 27 MOCK_METHOD2(SetProperty, bool(NPIdentifier, const NPVariant*));
36 MOCK_METHOD1(RemoveProperty, bool(NPIdentifier)); 28 MOCK_METHOD1(RemoveProperty, bool(NPIdentifier));
37 MOCK_METHOD2(Enumerate, bool(NPIdentifier**, uint32_t*)); 29 MOCK_METHOD2(Enumerate, bool(NPIdentifier**, uint32_t*));
38 MOCK_METHOD3(Construct, bool(const NPVariant*, uint32_t, NPVariant*)); 30 MOCK_METHOD3(Construct, bool(const NPVariant*, uint32_t, NPVariant*));
39 31
40 private: 32 private:
41 static int count_; 33 DISALLOW_COPY_AND_ASSIGN(MockNPObject);
42 }; 34 };
43 35
44 } // namespace gpu_plugin 36 } // namespace gpu_plugin
45 } // namespace o3d 37 } // namespace o3d
46 38
47 #endif // O3D_GPU_PLUGIN_NP_UTILS_BASE_NP_OBJECT_MOCK_H_ 39 #endif // O3D_GPU_PLUGIN_NP_UTILS_NP_OBJECT_MOCK_H_
OLDNEW
« no previous file with comments | « o3d/gpu_plugin/np_utils/np_dispatcher_specializations.h ('k') | o3d/gpu_plugin/np_utils/np_object_pointer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698