| 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 #ifndef PPAPI_TESTS_TEST_UTILS_H_ | 5 #ifndef PPAPI_TESTS_TEST_UTILS_H_ |
| 6 #define PPAPI_TESTS_TEST_UTILS_H_ | 6 #define PPAPI_TESTS_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/c/dev/ppb_testing_dev.h" | 10 #include "ppapi/c/dev/ppb_testing_dev.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port); | 27 bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port); |
| 28 | 28 |
| 29 uint16_t ConvertFromNetEndian16(uint16_t x); | 29 uint16_t ConvertFromNetEndian16(uint16_t x); |
| 30 uint16_t ConvertToNetEndian16(uint16_t x); | 30 uint16_t ConvertToNetEndian16(uint16_t x); |
| 31 bool EqualNetAddress(const pp::NetAddress& addr1, const pp::NetAddress& addr2); | 31 bool EqualNetAddress(const pp::NetAddress& addr1, const pp::NetAddress& addr2); |
| 32 // Only returns the first address if there are more than one available. | 32 // Only returns the first address if there are more than one available. |
| 33 bool ResolveHost(PP_Instance instance, | 33 bool ResolveHost(PP_Instance instance, |
| 34 const std::string& host, | 34 const std::string& host, |
| 35 uint16_t port, | 35 uint16_t port, |
| 36 pp::NetAddress* addr); | 36 pp::NetAddress* addr); |
| 37 bool ReplacePort(PP_Instance instance, |
| 38 const pp::NetAddress& input_addr, |
| 39 uint16_t port, |
| 40 pp::NetAddress* output_addr); |
| 41 uint16_t GetPort(const pp::NetAddress& addr); |
| 37 | 42 |
| 38 // NestedEvent allows you to run a nested MessageLoop and wait for a particular | 43 // NestedEvent allows you to run a nested MessageLoop and wait for a particular |
| 39 // event to complete. For example, you can use it to wait for a callback on a | 44 // event to complete. For example, you can use it to wait for a callback on a |
| 40 // PPP interface, which will "Signal" the event and make the loop quit. | 45 // PPP interface, which will "Signal" the event and make the loop quit. |
| 41 // "Wait()" will return immediately if it has already been signalled. Otherwise, | 46 // "Wait()" will return immediately if it has already been signalled. Otherwise, |
| 42 // it will run a nested message loop (using PPB_Testing.RunMessageLoop) and will | 47 // it will run a nested message loop (using PPB_Testing.RunMessageLoop) and will |
| 43 // return only after it has been signalled. | 48 // return only after it has been signalled. |
| 44 // Example: | 49 // Example: |
| 45 // std::string TestFullscreen::TestNormalToFullscreen() { | 50 // std::string TestFullscreen::TestNormalToFullscreen() { |
| 46 // pp::Fullscreen screen_mode(instance); | 51 // pp::Fullscreen screen_mode(instance); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 #error Please add support for your platform in ppapi/tests/test_utils.h | 336 #error Please add support for your platform in ppapi/tests/test_utils.h |
| 332 #endif | 337 #endif |
| 333 | 338 |
| 334 /* These are used to determine POSIX-like implementations vs Windows. */ | 339 /* These are used to determine POSIX-like implementations vs Windows. */ |
| 335 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ | 340 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ |
| 336 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) | 341 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) |
| 337 #define PPAPI_POSIX 1 | 342 #define PPAPI_POSIX 1 |
| 338 #endif | 343 #endif |
| 339 | 344 |
| 340 #endif // PPAPI_TESTS_TEST_UTILS_H_ | 345 #endif // PPAPI_TESTS_TEST_UTILS_H_ |
| OLD | NEW |