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

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

Issue 1440423003: Add support for HandleBlockingMessage to NaClMessageScanner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge with mseaborn's changes Created 4 years, 11 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
« no previous file with comments | « ppapi/tests/test_post_message.cc ('k') | no next file » | 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/pp_instance.h" 10 #include "ppapi/c/pp_instance.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 #else 289 #else
290 #error Please add support for your platform in ppapi/tests/test_utils.h 290 #error Please add support for your platform in ppapi/tests/test_utils.h
291 #endif 291 #endif
292 292
293 /* These are used to determine POSIX-like implementations vs Windows. */ 293 /* These are used to determine POSIX-like implementations vs Windows. */
294 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ 294 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
295 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) 295 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__)
296 #define PPAPI_POSIX 1 296 #define PPAPI_POSIX 1
297 #endif 297 #endif
298 298
299 // By default, ArrayBuffers over a certain size are sent via shared memory. In
300 // order to test for this without sending huge buffers, tests can use this
301 // class to set the minimum array buffer size used for shared memory temporarily
302 // lower.
303 class ScopedArrayBufferSizeSetter {
304 public:
305 ScopedArrayBufferSizeSetter(const PPB_Testing_Private* interface,
306 PP_Instance instance,
307 uint32_t threshold)
308 : interface_(interface),
309 instance_(instance) {
310 interface_->SetMinimumArrayBufferSizeForShmem(instance_, threshold);
311 }
312 ~ScopedArrayBufferSizeSetter() {
313 interface_->SetMinimumArrayBufferSizeForShmem(instance_, 0);
314 }
315 private:
316 const PPB_Testing_Private* interface_;
317 PP_Instance instance_;
318 };
319
299 #endif // PPAPI_TESTS_TEST_UTILS_H_ 320 #endif // PPAPI_TESTS_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « ppapi/tests/test_post_message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698