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 "ppapi/proxy/ppapi_proxy_test.h" | 5 #include "ppapi/proxy/ppapi_proxy_test.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 const void* ProxyTestHarnessBase::GetInterface(const char* name) { | 116 const void* ProxyTestHarnessBase::GetInterface(const char* name) { |
117 return registered_interfaces_[name]; | 117 return registered_interfaces_[name]; |
118 } | 118 } |
119 | 119 |
120 void ProxyTestHarnessBase::RegisterTestInterface(const char* name, | 120 void ProxyTestHarnessBase::RegisterTestInterface(const char* name, |
121 const void* test_interface) { | 121 const void* test_interface) { |
122 registered_interfaces_[name] = test_interface; | 122 registered_interfaces_[name] = test_interface; |
123 } | 123 } |
124 | 124 |
125 bool ProxyTestHarnessBase::IsInterfaceSupported(const char* name) { | 125 bool ProxyTestHarnessBase::SupportsInterface(const char* name) { |
126 sink().ClearMessages(); | 126 sink().ClearMessages(); |
127 | 127 |
128 // IPC doesn't actually write to this when we send a message manually | 128 // IPC doesn't actually write to this when we send a message manually |
129 // not actually using IPC. | 129 // not actually using IPC. |
130 bool unused_result = false; | 130 bool unused_result = false; |
131 PpapiMsg_IsInterfaceSupported msg(name, &unused_result); | 131 PpapiMsg_SupportsInterface msg(name, &unused_result); |
132 GetDispatcher()->OnMessageReceived(msg); | 132 GetDispatcher()->OnMessageReceived(msg); |
133 | 133 |
134 const IPC::Message* reply_msg = | 134 const IPC::Message* reply_msg = |
135 sink().GetUniqueMessageMatching(IPC_REPLY_ID); | 135 sink().GetUniqueMessageMatching(IPC_REPLY_ID); |
136 EXPECT_TRUE(reply_msg); | 136 EXPECT_TRUE(reply_msg); |
137 if (!reply_msg) | 137 if (!reply_msg) |
138 return false; | 138 return false; |
139 | 139 |
140 TupleTypes<PpapiMsg_IsInterfaceSupported::ReplyParam>::ValueTuple reply_data; | 140 TupleTypes<PpapiMsg_SupportsInterface::ReplyParam>::ValueTuple reply_data; |
141 EXPECT_TRUE(PpapiMsg_IsInterfaceSupported::ReadReplyParam( | 141 EXPECT_TRUE(PpapiMsg_SupportsInterface::ReadReplyParam( |
142 reply_msg, &reply_data)); | 142 reply_msg, &reply_data)); |
143 | 143 |
144 sink().ClearMessages(); | 144 sink().ClearMessages(); |
145 return reply_data.a; | 145 return reply_data.a; |
146 } | 146 } |
147 | 147 |
148 // PluginProxyTestHarness ------------------------------------------------------ | 148 // PluginProxyTestHarness ------------------------------------------------------ |
149 | 149 |
150 PluginProxyTestHarness::PluginProxyTestHarness( | 150 PluginProxyTestHarness::PluginProxyTestHarness( |
151 GlobalsConfiguration globals_config) | 151 GlobalsConfiguration globals_config) |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE, | 582 plugin_thread_.message_loop_proxy()->PostTask(FROM_HERE, |
583 base::Bind(&RunTaskOnRemoteHarness, | 583 base::Bind(&RunTaskOnRemoteHarness, |
584 task, | 584 task, |
585 &task_complete)); | 585 &task_complete)); |
586 task_complete.Wait(); | 586 task_complete.Wait(); |
587 } | 587 } |
588 | 588 |
589 | 589 |
590 } // namespace proxy | 590 } // namespace proxy |
591 } // namespace ppapi | 591 } // namespace ppapi |
OLD | NEW |