| OLD | NEW |
| 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 #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 "ppapi/shared_impl/ppapi_permissions.h" |
| 9 #include "webkit/plugins/ppapi/mock_plugin_delegate.h" | 10 #include "webkit/plugins/ppapi/mock_plugin_delegate.h" |
| 10 #include "webkit/plugins/ppapi/plugin_module.h" | 11 #include "webkit/plugins/ppapi/plugin_module.h" |
| 11 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" | 12 #include "webkit/plugins/ppapi/ppapi_interface_factory.h" |
| 12 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 13 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 13 | 14 |
| 14 namespace webkit { | 15 namespace webkit { |
| 15 namespace ppapi { | 16 namespace ppapi { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 PpapiUnittest::~PpapiUnittest() { | 70 PpapiUnittest::~PpapiUnittest() { |
| 70 DCHECK(current_unittest == this); | 71 DCHECK(current_unittest == this); |
| 71 current_unittest = NULL; | 72 current_unittest = NULL; |
| 72 } | 73 } |
| 73 | 74 |
| 74 void PpapiUnittest::SetUp() { | 75 void PpapiUnittest::SetUp() { |
| 75 delegate_.reset(NewPluginDelegate()); | 76 delegate_.reset(NewPluginDelegate()); |
| 76 | 77 |
| 77 // Initialize the mock module. | 78 // Initialize the mock module. |
| 78 module_ = new PluginModule("Mock plugin", FilePath(), this); | 79 module_ = new PluginModule("Mock plugin", FilePath(), this, |
| 80 ::ppapi::PpapiPermissions()); |
| 79 PluginModule::EntryPoints entry_points; | 81 PluginModule::EntryPoints entry_points; |
| 80 entry_points.get_interface = &MockGetInterface; | 82 entry_points.get_interface = &MockGetInterface; |
| 81 entry_points.initialize_module = &MockInitializeModule; | 83 entry_points.initialize_module = &MockInitializeModule; |
| 82 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); | 84 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); |
| 83 | 85 |
| 84 // Initialize the mock instance. | 86 // Initialize the mock instance. |
| 85 instance_ = PluginInstance::Create(delegate_.get(), module()); | 87 instance_ = PluginInstance::Create(delegate_.get(), module()); |
| 86 | 88 |
| 87 } | 89 } |
| 88 | 90 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 reset_result(); | 155 reset_result(); |
| 154 PpapiInterfaceFactoryManager::GetInstance()->UnregisterFactory( | 156 PpapiInterfaceFactoryManager::GetInstance()->UnregisterFactory( |
| 155 PpapiCustomInterfaceFactoryTest::InterfaceFactory); | 157 PpapiCustomInterfaceFactoryTest::InterfaceFactory); |
| 156 | 158 |
| 157 (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface"); | 159 (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface"); |
| 158 EXPECT_FALSE(result()); | 160 EXPECT_FALSE(result()); |
| 159 } | 161 } |
| 160 | 162 |
| 161 } // namespace ppapi | 163 } // namespace ppapi |
| 162 } // namespace webkit | 164 } // namespace webkit |
| OLD | NEW |