| 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/threading/simple_thread.h" | 13 #include "base/threading/simple_thread.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "ppapi/c/pp_instance.h" | 15 #include "ppapi/c/pp_instance.h" |
| 16 #include "ppapi/proxy/host_dispatcher.h" | 16 #include "ppapi/proxy/host_dispatcher.h" |
| 17 #include "ppapi/proxy/plugin_dispatcher.h" | 17 #include "ppapi/proxy/plugin_dispatcher.h" |
| 18 #include "ppapi/proxy/plugin_globals.h" | 18 #include "ppapi/proxy/plugin_globals.h" |
| 19 #include "ppapi/proxy/plugin_proxy_delegate.h" | 19 #include "ppapi/proxy/plugin_proxy_delegate.h" |
| 20 #include "ppapi/proxy/plugin_resource_tracker.h" | 20 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 21 #include "ppapi/proxy/plugin_var_tracker.h" | 21 #include "ppapi/proxy/plugin_var_tracker.h" |
| 22 #include "ppapi/proxy/resource_message_test_sink.h" | 22 #include "ppapi/proxy/resource_message_test_sink.h" |
| 23 #include "ppapi/shared_impl/proxy_lock.h" |
| 23 #include "ppapi/shared_impl/test_globals.h" | 24 #include "ppapi/shared_impl/test_globals.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| 27 class MessageLoopProxy; | 28 class MessageLoopProxy; |
| 28 class RunLoop; | 29 class RunLoop; |
| 29 } | 30 } |
| 30 | 31 |
| 31 namespace ppapi { | 32 namespace ppapi { |
| 32 namespace proxy { | 33 namespace proxy { |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 284 |
| 284 DISALLOW_COPY_AND_ASSIGN(DelegateMock); | 285 DISALLOW_COPY_AND_ASSIGN(DelegateMock); |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 private: | 288 private: |
| 288 void CreateHostGlobals(); | 289 void CreateHostGlobals(); |
| 289 | 290 |
| 290 GlobalsConfiguration globals_config_; | 291 GlobalsConfiguration globals_config_; |
| 291 scoped_ptr<ppapi::TestGlobals> host_globals_; | 292 scoped_ptr<ppapi::TestGlobals> host_globals_; |
| 292 scoped_ptr<HostDispatcher> host_dispatcher_; | 293 scoped_ptr<HostDispatcher> host_dispatcher_; |
| 294 // The host side of the real proxy doesn't lock, so this disables locking for |
| 295 // the thread the host side of the test runs on. |
| 296 scoped_ptr<ProxyLock::LockingDisablerForTest> disable_locking_; |
| 293 DelegateMock delegate_mock_; | 297 DelegateMock delegate_mock_; |
| 294 }; | 298 }; |
| 295 | 299 |
| 296 class HostProxyTest : public HostProxyTestHarness, public testing::Test { | 300 class HostProxyTest : public HostProxyTestHarness, public testing::Test { |
| 297 public: | 301 public: |
| 298 HostProxyTest(); | 302 HostProxyTest(); |
| 299 virtual ~HostProxyTest(); | 303 virtual ~HostProxyTest(); |
| 300 | 304 |
| 301 // testing::Test implementation. | 305 // testing::Test implementation. |
| 302 virtual void SetUp(); | 306 virtual void SetUp(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 // EXPECT_VAR_IS_STRING("foo", my_var); | 363 // EXPECT_VAR_IS_STRING("foo", my_var); |
| 360 #define EXPECT_VAR_IS_STRING(str, var) { \ | 364 #define EXPECT_VAR_IS_STRING(str, var) { \ |
| 361 StringVar* sv = StringVar::FromPPVar(var); \ | 365 StringVar* sv = StringVar::FromPPVar(var); \ |
| 362 EXPECT_TRUE(sv); \ | 366 EXPECT_TRUE(sv); \ |
| 363 if (sv) \ | 367 if (sv) \ |
| 364 EXPECT_EQ(str, sv->value()); \ | 368 EXPECT_EQ(str, sv->value()); \ |
| 365 } | 369 } |
| 366 | 370 |
| 367 } // namespace proxy | 371 } // namespace proxy |
| 368 } // namespace ppapi | 372 } // namespace ppapi |
| OLD | NEW |