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 #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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static void Handler(void* user_data, int32_t result); | 42 static void Handler(void* user_data, int32_t result); |
43 | 43 |
44 bool have_result_; | 44 bool have_result_; |
45 int32_t result_; | 45 int32_t result_; |
46 bool force_async_; | 46 bool force_async_; |
47 bool post_quit_task_; | 47 bool post_quit_task_; |
48 unsigned run_count_; | 48 unsigned run_count_; |
49 PP_Instance instance_; | 49 PP_Instance instance_; |
50 }; | 50 }; |
51 | 51 |
| 52 /* |
| 53 * A set of macros to use for platform detection. These were largely copied |
| 54 * from chromium's build_config.h. |
| 55 */ |
| 56 #if defined(__APPLE__) |
| 57 #define PPAPI_OS_MACOSX 1 |
| 58 #elif defined(ANDROID) |
| 59 #define PPAPI_OS_ANDROID 1 |
| 60 #elif defined(__native_client__) |
| 61 #define PPAPI_OS_NACL 1 |
| 62 #elif defined(__linux__) |
| 63 #define PPAPI_OS_LINUX 1 |
| 64 #elif defined(_WIN32) |
| 65 #define PPAPI_OS_WIN 1 |
| 66 #elif defined(__FreeBSD__) |
| 67 #define PPAPI_OS_FREEBSD 1 |
| 68 #elif defined(__OpenBSD__) |
| 69 #define PPAPI_OS_OPENBSD 1 |
| 70 #elif defined(__sun) |
| 71 #define PPAPI_OS_SOLARIS 1 |
| 72 #else |
| 73 #error Please add support for your platform in ppapi/c/pp_macros.h. |
| 74 #endif |
| 75 |
| 76 /* These are used to determine POSIX-like implementations vs Windows. */ |
| 77 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ |
| 78 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) |
| 79 #define PPAPI_POSIX 1 |
| 80 #endif |
| 81 |
| 82 // This is roughly copied from base/compiler_specific.h, and makes it possible |
| 83 // to pass 'this' in a constructor initializer list, when you really mean it. |
| 84 // |
| 85 // Example usage: |
| 86 // Foo::Foo(MyInstance* instance) |
| 87 // : ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) {} |
| 88 #if defined(COMPILER_MSVC) |
| 89 #define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) \ |
| 90 __pragma(warning(push)) \ |
| 91 __pragma(warning(disable:4355)) \ |
| 92 code \ |
| 93 __pragma(warning(pop)) |
| 94 #else |
| 95 #define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) code |
| 96 #endif |
| 97 |
52 #endif // PPAPI_TESTS_TEST_UTILS_H_ | 98 #endif // PPAPI_TESTS_TEST_UTILS_H_ |
OLD | NEW |