| 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 #include "webkit/plugins/ppapi/ppapi_unittest.h" | 5 #include "webkit/plugins/ppapi/ppapi_unittest.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_var.h" | 7 #include "ppapi/c/pp_var.h" |
| 8 #include "ppapi/c/ppp_instance.h" | 8 #include "ppapi/c/ppp_instance.h" |
| 9 #include "webkit/plugins/ppapi/mock_plugin_delegate.h" | 9 #include "webkit/plugins/ppapi/mock_plugin_delegate.h" |
| 10 #include "webkit/plugins/ppapi/plugin_module.h" | 10 #include "webkit/plugins/ppapi/plugin_module.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 delegate_.reset(NewPluginDelegate()); | 75 delegate_.reset(NewPluginDelegate()); |
| 76 | 76 |
| 77 // Initialize the mock module. | 77 // Initialize the mock module. |
| 78 module_ = new PluginModule("Mock plugin", FilePath(), this); | 78 module_ = new PluginModule("Mock plugin", FilePath(), this); |
| 79 PluginModule::EntryPoints entry_points; | 79 PluginModule::EntryPoints entry_points; |
| 80 entry_points.get_interface = &MockGetInterface; | 80 entry_points.get_interface = &MockGetInterface; |
| 81 entry_points.initialize_module = &MockInitializeModule; | 81 entry_points.initialize_module = &MockInitializeModule; |
| 82 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); | 82 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); |
| 83 | 83 |
| 84 // Initialize the mock instance. | 84 // Initialize the mock instance. |
| 85 instance_ = PluginInstance::Create1_0( | 85 instance_ = PluginInstance::Create(delegate_.get(), module()); |
| 86 delegate_.get(), | |
| 87 module(), | |
| 88 GetMockInterface(PPP_INSTANCE_INTERFACE_1_0)); | |
| 89 | 86 |
| 90 } | 87 } |
| 91 | 88 |
| 92 void PpapiUnittest::TearDown() { | 89 void PpapiUnittest::TearDown() { |
| 93 instance_ = NULL; | 90 instance_ = NULL; |
| 94 module_ = NULL; | 91 module_ = NULL; |
| 95 } | 92 } |
| 96 | 93 |
| 97 MockPluginDelegate* PpapiUnittest::NewPluginDelegate() { | 94 MockPluginDelegate* PpapiUnittest::NewPluginDelegate() { |
| 98 return new MockPluginDelegate; | 95 return new MockPluginDelegate; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 reset_result(); | 153 reset_result(); |
| 157 PpapiInterfaceFactoryManager::GetInstance()->UnregisterFactory( | 154 PpapiInterfaceFactoryManager::GetInstance()->UnregisterFactory( |
| 158 PpapiCustomInterfaceFactoryTest::InterfaceFactory); | 155 PpapiCustomInterfaceFactoryTest::InterfaceFactory); |
| 159 | 156 |
| 160 (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface"); | 157 (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface"); |
| 161 EXPECT_FALSE(result()); | 158 EXPECT_FALSE(result()); |
| 162 } | 159 } |
| 163 | 160 |
| 164 } // namespace ppapi | 161 } // namespace ppapi |
| 165 } // namespace webkit | 162 } // namespace webkit |
| OLD | NEW |