| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 TestCompletionCallbackWithOutput(PP_Instance instance, | 183 TestCompletionCallbackWithOutput(PP_Instance instance, |
| 184 CallbackType callback_type) : | 184 CallbackType callback_type) : |
| 185 TestCompletionCallback(instance, callback_type) { | 185 TestCompletionCallback(instance, callback_type) { |
| 186 } | 186 } |
| 187 | 187 |
| 188 pp::CompletionCallbackWithOutput<OutputT> GetCallbackWithOutput(); | 188 pp::CompletionCallbackWithOutput<OutputT> GetCallbackWithOutput(); |
| 189 operator pp::CompletionCallbackWithOutput<OutputT>() { | 189 operator pp::CompletionCallbackWithOutput<OutputT>() { |
| 190 return GetCallbackWithOutput(); | 190 return GetCallbackWithOutput(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 const OutputT& output() { return output_storage_.output(); } | 193 OutputT output() { |
| 194 return pp::internal::CallbackOutputTraits<OutputT>::StorageToPluginArg( |
| 195 output_storage_); |
| 196 } |
| 194 | 197 |
| 195 typename pp::CompletionCallbackWithOutput<OutputT>::OutputStorageType | 198 typename pp::CompletionCallbackWithOutput<OutputT>::OutputStorageType |
| 196 output_storage_; | 199 output_storage_; |
| 197 }; | 200 }; |
| 198 | 201 |
| 199 template <typename OutputT> | 202 template <typename OutputT> |
| 200 pp::CompletionCallbackWithOutput<OutputT> | 203 pp::CompletionCallbackWithOutput<OutputT> |
| 201 TestCompletionCallbackWithOutput<OutputT>::GetCallbackWithOutput() { | 204 TestCompletionCallbackWithOutput<OutputT>::GetCallbackWithOutput() { |
| 202 Reset(); | 205 Reset(); |
| 203 if (callback_type_ == PP_BLOCKING) { | 206 if (callback_type_ == PP_BLOCKING) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 #error Please add support for your platform in ppapi/tests/test_utils.h | 255 #error Please add support for your platform in ppapi/tests/test_utils.h |
| 253 #endif | 256 #endif |
| 254 | 257 |
| 255 /* These are used to determine POSIX-like implementations vs Windows. */ | 258 /* These are used to determine POSIX-like implementations vs Windows. */ |
| 256 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ | 259 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ |
| 257 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) | 260 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) |
| 258 #define PPAPI_POSIX 1 | 261 #define PPAPI_POSIX 1 |
| 259 #endif | 262 #endif |
| 260 | 263 |
| 261 #endif // PPAPI_TESTS_TEST_UTILS_H_ | 264 #endif // PPAPI_TESTS_TEST_UTILS_H_ |
| OLD | NEW |