| 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 WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_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 "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "webkit/plugins/ppapi/plugin_delegate.h" | 12 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 13 | 13 |
| 14 namespace base { |
| 15 class MessageLoop; |
| 16 } |
| 17 |
| 14 namespace webkit { | 18 namespace webkit { |
| 15 namespace ppapi { | 19 namespace ppapi { |
| 16 | 20 |
| 17 class MockPluginDelegate; | 21 class MockPluginDelegate; |
| 18 class PluginInstance; | 22 class PluginInstance; |
| 19 class PluginModule; | 23 class PluginModule; |
| 20 | 24 |
| 21 class PpapiUnittest : public testing::Test, | 25 class PpapiUnittest : public testing::Test, |
| 22 public webkit::ppapi::PluginDelegate::ModuleLifetime { | 26 public webkit::ppapi::PluginDelegate::ModuleLifetime { |
| 23 public: | 27 public: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 protected: | 48 protected: |
| 45 virtual MockPluginDelegate* NewPluginDelegate(); | 49 virtual MockPluginDelegate* NewPluginDelegate(); |
| 46 | 50 |
| 47 private: | 51 private: |
| 48 scoped_ptr<MockPluginDelegate> delegate_; | 52 scoped_ptr<MockPluginDelegate> delegate_; |
| 49 | 53 |
| 50 // Note: module must be declared first since we want it to get destroyed last. | 54 // Note: module must be declared first since we want it to get destroyed last. |
| 51 scoped_refptr<PluginModule> module_; | 55 scoped_refptr<PluginModule> module_; |
| 52 scoped_refptr<PluginInstance> instance_; | 56 scoped_refptr<PluginInstance> instance_; |
| 53 | 57 |
| 58 scoped_ptr<base::MessageLoop> message_loop_; |
| 59 |
| 54 // ModuleLifetime implementation. | 60 // ModuleLifetime implementation. |
| 55 virtual void PluginModuleDead(PluginModule* dead_module); | 61 virtual void PluginModuleDead(PluginModule* dead_module); |
| 56 | 62 |
| 57 DISALLOW_COPY_AND_ASSIGN(PpapiUnittest); | 63 DISALLOW_COPY_AND_ASSIGN(PpapiUnittest); |
| 58 }; | 64 }; |
| 59 | 65 |
| 60 } // namespace ppapi | 66 } // namespace ppapi |
| 61 } // namespace webkit | 67 } // namespace webkit |
| 62 | 68 |
| 63 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_ | 69 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_ |
| OLD | NEW |