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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.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 "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
| 13 #include "base/task_runner.h" |
13 #include "base/threading/simple_thread.h" | 14 #include "base/threading/simple_thread.h" |
14 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
15 #include "ppapi/c/pp_instance.h" | 16 #include "ppapi/c/pp_instance.h" |
16 #include "ppapi/proxy/host_dispatcher.h" | 17 #include "ppapi/proxy/host_dispatcher.h" |
17 #include "ppapi/proxy/plugin_dispatcher.h" | 18 #include "ppapi/proxy/plugin_dispatcher.h" |
18 #include "ppapi/proxy/plugin_globals.h" | 19 #include "ppapi/proxy/plugin_globals.h" |
19 #include "ppapi/proxy/plugin_proxy_delegate.h" | 20 #include "ppapi/proxy/plugin_proxy_delegate.h" |
20 #include "ppapi/proxy/plugin_resource_tracker.h" | 21 #include "ppapi/proxy/plugin_resource_tracker.h" |
21 #include "ppapi/proxy/plugin_var_tracker.h" | 22 #include "ppapi/proxy/plugin_var_tracker.h" |
22 #include "ppapi/proxy/resource_message_test_sink.h" | 23 #include "ppapi/proxy/resource_message_test_sink.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 private: | 159 private: |
159 base::MessageLoopProxy* ipc_message_loop_; // Weak | 160 base::MessageLoopProxy* ipc_message_loop_; // Weak |
160 base::WaitableEvent* shutdown_event_; // Weak | 161 base::WaitableEvent* shutdown_event_; // Weak |
161 std::set<PP_Instance> instance_id_set_; | 162 std::set<PP_Instance> instance_id_set_; |
162 IPC::Sender* browser_sender_; | 163 IPC::Sender* browser_sender_; |
163 | 164 |
164 DISALLOW_COPY_AND_ASSIGN(PluginDelegateMock); | 165 DISALLOW_COPY_AND_ASSIGN(PluginDelegateMock); |
165 }; | 166 }; |
166 | 167 |
167 private: | 168 private: |
168 void CreatePluginGlobals(); | 169 void CreatePluginGlobals( |
| 170 const scoped_refptr<base::TaskRunner>& ipc_task_runner); |
169 | 171 |
170 GlobalsConfiguration globals_config_; | 172 GlobalsConfiguration globals_config_; |
171 scoped_ptr<PluginGlobals> plugin_globals_; | 173 scoped_ptr<PluginGlobals> plugin_globals_; |
172 | 174 |
173 scoped_ptr<PluginDispatcher> plugin_dispatcher_; | 175 scoped_ptr<PluginDispatcher> plugin_dispatcher_; |
174 PluginDelegateMock plugin_delegate_mock_; | 176 PluginDelegateMock plugin_delegate_mock_; |
175 }; | 177 }; |
176 | 178 |
177 class PluginProxyTest : public PluginProxyTestHarness, public testing::Test { | 179 class PluginProxyTest : public PluginProxyTestHarness, public testing::Test { |
178 public: | 180 public: |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 // EXPECT_VAR_IS_STRING("foo", my_var); | 365 // EXPECT_VAR_IS_STRING("foo", my_var); |
364 #define EXPECT_VAR_IS_STRING(str, var) { \ | 366 #define EXPECT_VAR_IS_STRING(str, var) { \ |
365 StringVar* sv = StringVar::FromPPVar(var); \ | 367 StringVar* sv = StringVar::FromPPVar(var); \ |
366 EXPECT_TRUE(sv); \ | 368 EXPECT_TRUE(sv); \ |
367 if (sv) \ | 369 if (sv) \ |
368 EXPECT_EQ(str, sv->value()); \ | 370 EXPECT_EQ(str, sv->value()); \ |
369 } | 371 } |
370 | 372 |
371 } // namespace proxy | 373 } // namespace proxy |
372 } // namespace ppapi | 374 } // namespace ppapi |
OLD | NEW |