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 "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "ppapi/c/pp_var.h" | 8 #include "ppapi/c/pp_var.h" |
9 #include "ppapi/c/ppp_instance.h" | 9 #include "ppapi/c/ppp_instance.h" |
10 #include "ppapi/shared_impl/ppapi_globals.h" | 10 #include "ppapi/shared_impl/ppapi_globals.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Initialize the mock module. | 83 // Initialize the mock module. |
84 module_ = new PluginModule("Mock plugin", base::FilePath(), this, | 84 module_ = new PluginModule("Mock plugin", base::FilePath(), this, |
85 ::ppapi::PpapiPermissions()); | 85 ::ppapi::PpapiPermissions()); |
86 ::ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting(); | 86 ::ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting(); |
87 PluginModule::EntryPoints entry_points; | 87 PluginModule::EntryPoints entry_points; |
88 entry_points.get_interface = &MockGetInterface; | 88 entry_points.get_interface = &MockGetInterface; |
89 entry_points.initialize_module = &MockInitializeModule; | 89 entry_points.initialize_module = &MockInitializeModule; |
90 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); | 90 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); |
91 | 91 |
92 // Initialize the mock instance. | 92 // Initialize the mock instance. |
93 instance_ = PluginInstance::Create(delegate_.get(), module(), NULL, GURL()); | 93 instance_ = PluginInstance::Create(delegate_.get(), NULL, module(), NULL, |
| 94 GURL()); |
94 } | 95 } |
95 | 96 |
96 void PpapiUnittest::TearDown() { | 97 void PpapiUnittest::TearDown() { |
97 instance_ = NULL; | 98 instance_ = NULL; |
98 module_ = NULL; | 99 module_ = NULL; |
99 message_loop_.reset(); | 100 message_loop_.reset(); |
100 PluginModule::ResetHostGlobalsForTest(); | 101 PluginModule::ResetHostGlobalsForTest(); |
101 } | 102 } |
102 | 103 |
103 MockPluginDelegate* PpapiUnittest::NewPluginDelegate() { | 104 MockPluginDelegate* PpapiUnittest::NewPluginDelegate() { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 reset_result(); | 164 reset_result(); |
164 PpapiInterfaceFactoryManager::GetInstance()->UnregisterFactory( | 165 PpapiInterfaceFactoryManager::GetInstance()->UnregisterFactory( |
165 PpapiCustomInterfaceFactoryTest::InterfaceFactory); | 166 PpapiCustomInterfaceFactoryTest::InterfaceFactory); |
166 | 167 |
167 (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface"); | 168 (*PluginModule::GetLocalGetInterfaceFunc())("DummyInterface"); |
168 EXPECT_FALSE(result()); | 169 EXPECT_FALSE(result()); |
169 } | 170 } |
170 | 171 |
171 } // namespace ppapi | 172 } // namespace ppapi |
172 } // namespace webkit | 173 } // namespace webkit |
OLD | NEW |