OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tests/test_broker.h" | 5 #include "ppapi/tests/test_broker.h" |
6 | 6 |
7 #if defined(_MSC_VER) | 7 #if defined(_MSC_VER) |
8 #define OS_WIN 1 | 8 #define OS_WIN 1 |
9 #include <windows.h> | 9 #include <windows.h> |
10 #else | 10 #else |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 : TestCase(instance), | 200 : TestCase(instance), |
201 broker_interface_(NULL) { | 201 broker_interface_(NULL) { |
202 } | 202 } |
203 | 203 |
204 bool TestBroker::Init() { | 204 bool TestBroker::Init() { |
205 broker_interface_ = static_cast<PPB_BrokerTrusted const*>( | 205 broker_interface_ = static_cast<PPB_BrokerTrusted const*>( |
206 pp::Module::Get()->GetBrowserInterface(PPB_BROKER_TRUSTED_INTERFACE)); | 206 pp::Module::Get()->GetBrowserInterface(PPB_BROKER_TRUSTED_INTERFACE)); |
207 return !!broker_interface_; | 207 return !!broker_interface_; |
208 } | 208 } |
209 | 209 |
210 void TestBroker::RunTest() { | 210 void TestBroker::RunTests(const std::string& filter) { |
211 RUN_TEST(Create); | 211 RUN_TEST(Create, filter); |
212 RUN_TEST(GetHandleFailure); | 212 RUN_TEST(Create, filter); |
213 RUN_TEST(ConnectFailure); | 213 RUN_TEST(GetHandleFailure, filter); |
| 214 RUN_TEST(ConnectFailure, filter); |
214 #if !defined(OS_WIN) // This is broken on Windows. See http://crbug.com/103975. | 215 #if !defined(OS_WIN) // This is broken on Windows. See http://crbug.com/103975. |
215 RUN_TEST(ConnectAndPipe); | 216 RUN_TEST(ConnectAndPipe, filter); |
216 #endif | 217 #endif |
217 } | 218 } |
218 | 219 |
219 std::string TestBroker::TestCreate() { | 220 std::string TestBroker::TestCreate() { |
220 // Very simplistic test to make sure we can create a broker interface. | 221 // Very simplistic test to make sure we can create a broker interface. |
221 PP_Resource broker = broker_interface_->CreateTrusted( | 222 PP_Resource broker = broker_interface_->CreateTrusted( |
222 instance_->pp_instance()); | 223 instance_->pp_instance()); |
223 ASSERT_TRUE(broker); | 224 ASSERT_TRUE(broker); |
224 | 225 |
225 ASSERT_FALSE(broker_interface_->IsBrokerTrusted(0)); | 226 ASSERT_FALSE(broker_interface_->IsBrokerTrusted(0)); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 281 |
281 PlatformFile file = IntToPlatformFile(handle); | 282 PlatformFile file = IntToPlatformFile(handle); |
282 ASSERT_TRUE(VerifyMessage(file, sizeof(kHelloMessage), kHelloMessage)); | 283 ASSERT_TRUE(VerifyMessage(file, sizeof(kHelloMessage), kHelloMessage)); |
283 ASSERT_TRUE(VerifyMessage(file, sizeof(kBrokerUnsandboxed), | 284 ASSERT_TRUE(VerifyMessage(file, sizeof(kBrokerUnsandboxed), |
284 kBrokerUnsandboxed)); | 285 kBrokerUnsandboxed)); |
285 | 286 |
286 ASSERT_TRUE(ClosePlatformFile(file)); | 287 ASSERT_TRUE(ClosePlatformFile(file)); |
287 | 288 |
288 PASS(); | 289 PASS(); |
289 } | 290 } |
OLD | NEW |