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

Unified Diff: ppapi/tests/test_post_message.cc

Issue 14208016: Hookup RawVarData to SerializedVar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/tests/test_post_message.cc
diff --git a/ppapi/tests/test_post_message.cc b/ppapi/tests/test_post_message.cc
index 8b16620ed80a64139d44dbcdd0cfc20b1fb1000b..47e50923fb678174fb16db6464b9063808977f7f 100644
--- a/ppapi/tests/test_post_message.cc
+++ b/ppapi/tests/test_post_message.cc
@@ -58,6 +58,23 @@ void InvokePostMessageThreadFunc(void* user_data) {
delete arg;
}
+class ScopedArrayBufferSizeSetter {
+ public:
+ ScopedArrayBufferSizeSetter(const PPB_Testing_Dev* interface,
+ PP_Instance instance,
+ uint32_t threshhold)
+ : interface_(interface),
+ instance_(instance) {
+ interface_->SetMinimumArrayBufferSizeForShmem(instance_, threshhold);
+ }
+ ~ScopedArrayBufferSizeSetter() {
+ interface_->SetMinimumArrayBufferSizeForShmem(instance_, 0);
+ }
+ private:
+ const PPB_Testing_Dev* interface_;
+ PP_Instance instance_;
+};
+
#define FINISHED_WAITING_MESSAGE "TEST_POST_MESSAGE_FINISHED_WAITING"
} // namespace
@@ -261,11 +278,10 @@ std::string TestPostMessage::TestSendingArrayBuffer() {
// TODO(sehr,dmichael): Add testing of longer array buffers when
// crbug.com/110086 is fixed.
-#if defined(OS_LINUX)
- uint32_t sizes[] = { 0, 100, 1000, 10000, 100000, 1000000 };
-#else
- uint32_t sizes[] = { 0, 100, 1000, 10000, 100000 };
-#endif
+ ScopedArrayBufferSizeSetter setter(testing_interface_,
+ instance_->pp_instance(),
+ 200);
+ uint32_t sizes[] = { 0, 100, 1000, 10000 };
for (size_t i = 0; i < sizeof(sizes)/sizeof(sizes[i]); ++i) {
std::ostringstream size_stream;
size_stream << sizes[i];

Powered by Google App Engine
This is Rietveld 408576698