Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: ppapi/tests/test_utils.h

Issue 14139012: PPAPI: More test cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Provide a message loop for "background thread" test so we can use a REQUIRED callback Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_udp_socket_private_disallowed.cc ('k') | ppapi/tests/test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // TODO(dmichael): Remove this constructor. 86 // TODO(dmichael): Remove this constructor.
87 TestCompletionCallback(PP_Instance instance, bool force_async); 87 TestCompletionCallback(PP_Instance instance, bool force_async);
88 88
89 TestCompletionCallback(PP_Instance instance, CallbackType callback_type); 89 TestCompletionCallback(PP_Instance instance, CallbackType callback_type);
90 90
91 // Sets a Delegate instance. OnCallback() of this instance will be invoked 91 // Sets a Delegate instance. OnCallback() of this instance will be invoked
92 // when the completion callback is invoked. 92 // when the completion callback is invoked.
93 // The delegate will be reset when Reset() or GetCallback() is called. 93 // The delegate will be reset when Reset() or GetCallback() is called.
94 void SetDelegate(Delegate* delegate) { delegate_ = delegate; } 94 void SetDelegate(Delegate* delegate) { delegate_ = delegate; }
95 95
96 // Waits for the callback to be called and returns the
97 // result. Returns immediately if the callback was previously called
98 // and the result wasn't returned (i.e. each result value received
99 // by the callback is returned by WaitForResult() once and only
100 // once). DEPRECATED: Please use the one below.
101 // TODO(dmichael): Remove this one when all the tests are updated.
102 int32_t WaitForResult();
103
104 // Wait for a result, given the return from the call which took this callback 96 // Wait for a result, given the return from the call which took this callback
105 // as a parameter. If |result| is PP_OK_COMPLETIONPENDING, WaitForResult will 97 // as a parameter. If |result| is PP_OK_COMPLETIONPENDING, WaitForResult will
106 // block until its callback has been invoked (in some cases, this will already 98 // block until its callback has been invoked (in some cases, this will already
107 // have happened, and WaitForCallback can return immediately). 99 // have happened, and WaitForCallback can return immediately).
108 // For any other values, WaitForResult will simply set its internal "result_" 100 // For any other values, WaitForResult will simply set its internal "result_"
109 // field. To retrieve the final result of the operation (i.e., the result 101 // field. To retrieve the final result of the operation (i.e., the result
110 // the callback has run, if necessary), call result(). You can call result() 102 // the callback has run, if necessary), call result(). You can call result()
111 // as many times as necessary until a new pp::CompletionCallback is retrieved. 103 // as many times as necessary until a new pp::CompletionCallback is retrieved.
112 // 104 //
113 // In some cases, you may want to check that the callback was invoked in the 105 // In some cases, you may want to check that the callback was invoked in the
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 #error Please add support for your platform in ppapi/tests/test_utils.h 264 #error Please add support for your platform in ppapi/tests/test_utils.h
273 #endif 265 #endif
274 266
275 /* These are used to determine POSIX-like implementations vs Windows. */ 267 /* These are used to determine POSIX-like implementations vs Windows. */
276 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ 268 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
277 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) 269 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__)
278 #define PPAPI_POSIX 1 270 #define PPAPI_POSIX 1
279 #endif 271 #endif
280 272
281 #endif // PPAPI_TESTS_TEST_UTILS_H_ 273 #endif // PPAPI_TESTS_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « ppapi/tests/test_udp_socket_private_disallowed.cc ('k') | ppapi/tests/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698