OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPAPI_UNITTEST_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPAPI_UNITTEST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/renderer/pepper/plugin_delegate.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "webkit/plugins/ppapi/plugin_delegate.h" | |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class MessageLoop; | 15 class MessageLoop; |
16 } | 16 } |
17 | 17 |
18 namespace webkit { | 18 namespace webkit { |
19 namespace ppapi { | 19 namespace ppapi { |
20 | 20 |
21 class MockPluginDelegate; | 21 class MockPluginDelegate; |
22 class PluginInstanceImpl; | 22 class PluginInstanceImpl; |
23 class PluginModule; | 23 class PluginModule; |
24 | 24 |
25 class PpapiUnittest : public testing::Test, | 25 class PpapiUnittest : public testing::Test { |
26 public webkit::ppapi::PluginDelegate::ModuleLifetime { | |
27 public: | 26 public: |
28 PpapiUnittest(); | 27 PpapiUnittest(); |
29 virtual ~PpapiUnittest(); | 28 virtual ~PpapiUnittest(); |
30 | 29 |
31 virtual void SetUp(); | 30 virtual void SetUp(); |
32 virtual void TearDown(); | 31 virtual void TearDown(); |
33 | 32 |
34 MockPluginDelegate* delegate() { return delegate_.get(); } | 33 MockPluginDelegate* delegate() { return delegate_.get(); } |
35 PluginModule* module() const { return module_.get(); } | 34 PluginModule* module() const { return module_.get(); } |
36 PluginInstanceImpl* instance() const { return instance_.get(); } | 35 PluginInstanceImpl* instance() const { return instance_.get(); } |
(...skipping 13 matching lines...) Expand all Loading... |
50 | 49 |
51 private: | 50 private: |
52 scoped_ptr<MockPluginDelegate> delegate_; | 51 scoped_ptr<MockPluginDelegate> delegate_; |
53 | 52 |
54 // Note: module must be declared first since we want it to get destroyed last. | 53 // Note: module must be declared first since we want it to get destroyed last. |
55 scoped_refptr<PluginModule> module_; | 54 scoped_refptr<PluginModule> module_; |
56 scoped_refptr<PluginInstanceImpl> instance_; | 55 scoped_refptr<PluginInstanceImpl> instance_; |
57 | 56 |
58 scoped_ptr<base::MessageLoop> message_loop_; | 57 scoped_ptr<base::MessageLoop> message_loop_; |
59 | 58 |
60 // ModuleLifetime implementation. | |
61 virtual void PluginModuleDead(PluginModule* dead_module); | |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(PpapiUnittest); | 59 DISALLOW_COPY_AND_ASSIGN(PpapiUnittest); |
64 }; | 60 }; |
65 | 61 |
66 } // namespace ppapi | 62 } // namespace ppapi |
67 } // namespace webkit | 63 } // namespace webkit |
68 | 64 |
69 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_ | 65 #endif // CONTENT_RENDERER_PEPPER_PPAPI_UNITTEST_H_ |
OLD | NEW |