| 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/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 |
| 11 #define OS_POSIX 1 | 11 #define OS_POSIX 1 |
| 12 #include <errno.h> | 12 #include <errno.h> |
| 13 #include <unistd.h> | 13 #include <unistd.h> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include <stddef.h> |
| 17 #include <stdint.h> |
| 18 |
| 16 #include <cstdio> | 19 #include <cstdio> |
| 17 #include <cstring> | 20 #include <cstring> |
| 18 #include <fstream> | 21 #include <fstream> |
| 19 #include <limits> | 22 #include <limits> |
| 20 | 23 |
| 21 #include "ppapi/c/pp_errors.h" | 24 #include "ppapi/c/pp_errors.h" |
| 25 #include "ppapi/c/trusted/ppb_broker_trusted.h" |
| 22 #include "ppapi/c/trusted/ppp_broker.h" | 26 #include "ppapi/c/trusted/ppp_broker.h" |
| 23 #include "ppapi/c/trusted/ppb_broker_trusted.h" | |
| 24 #include "ppapi/tests/test_utils.h" | 27 #include "ppapi/tests/test_utils.h" |
| 25 #include "ppapi/tests/testing_instance.h" | 28 #include "ppapi/tests/testing_instance.h" |
| 26 | 29 |
| 27 REGISTER_TEST_CASE(Broker); | 30 REGISTER_TEST_CASE(Broker); |
| 28 | 31 |
| 29 namespace { | 32 namespace { |
| 30 | 33 |
| 31 const char kHelloMessage[] = "Hello Plugin! This is Broker!"; | 34 const char kHelloMessage[] = "Hello Plugin! This is Broker!"; |
| 32 // Message sent from broker to plugin if the broker is unsandboxed. | 35 // Message sent from broker to plugin if the broker is unsandboxed. |
| 33 const char kBrokerUnsandboxed[] = "Broker is Unsandboxed!"; | 36 const char kBrokerUnsandboxed[] = "Broker is Unsandboxed!"; |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 346 } |
| 344 | 347 |
| 345 std::string TestBroker::TestIsAllowedPermissionGranted() { | 348 std::string TestBroker::TestIsAllowedPermissionGranted() { |
| 346 PP_Resource broker = broker_interface_->CreateTrusted( | 349 PP_Resource broker = broker_interface_->CreateTrusted( |
| 347 instance_->pp_instance()); | 350 instance_->pp_instance()); |
| 348 ASSERT_TRUE(broker); | 351 ASSERT_TRUE(broker); |
| 349 ASSERT_EQ(PP_TRUE, broker_interface_->IsAllowed(broker)); | 352 ASSERT_EQ(PP_TRUE, broker_interface_->IsAllowed(broker)); |
| 350 | 353 |
| 351 PASS(); | 354 PASS(); |
| 352 } | 355 } |
| OLD | NEW |