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

Side by Side Diff: ppapi/tests/test_post_message.cc

Issue 9358030: PPAPI: Dial back the PostMessage threading test and re-enable on Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « chrome/test/ui/ppapi_uitest.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 #include "ppapi/tests/test_post_message.h" 5 #include "ppapi/tests/test_post_message.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "ppapi/c/dev/ppb_testing_dev.h" 10 #include "ppapi/c/dev/ppb_testing_dev.h"
(...skipping 11 matching lines...) Expand all
22 #endif 22 #endif
23 23
24 REGISTER_TEST_CASE(PostMessage); 24 REGISTER_TEST_CASE(PostMessage);
25 25
26 namespace { 26 namespace {
27 27
28 const char kTestString[] = "Hello world!"; 28 const char kTestString[] = "Hello world!";
29 const bool kTestBool = true; 29 const bool kTestBool = true;
30 const int32_t kTestInt = 42; 30 const int32_t kTestInt = 42;
31 const double kTestDouble = 42.0; 31 const double kTestDouble = 42.0;
32
33 // On Windows XP bots, the NonMainThread test can run very slowly. So we dial
34 // back the number of threads & messages when running on Windows.
35 #ifdef PPAPI_OS_WIN
36 const int32_t kThreadsToRun = 2;
37 const int32_t kMessagesToSendPerThread = 5;
38 #else
32 const int32_t kThreadsToRun = 4; 39 const int32_t kThreadsToRun = 4;
33 const int32_t kMessagesToSendPerThread = 10; 40 const int32_t kMessagesToSendPerThread = 10;
41 #endif
34 42
35 // The struct that invoke_post_message_thread_func expects for its argument. 43 // The struct that invoke_post_message_thread_func expects for its argument.
36 // It includes the instance on which to invoke PostMessage, and the value to 44 // It includes the instance on which to invoke PostMessage, and the value to
37 // pass to PostMessage. 45 // pass to PostMessage.
38 struct InvokePostMessageThreadArg { 46 struct InvokePostMessageThreadArg {
39 InvokePostMessageThreadArg(pp::Instance* i, const pp::Var& v) 47 InvokePostMessageThreadArg(pp::Instance* i, const pp::Var& v)
40 : instance(i), value_to_send(v) {} 48 : instance(i), value_to_send(v) {}
41 pp::Instance* instance; 49 pp::Instance* instance;
42 pp::Var value_to_send; 50 pp::Var value_to_send;
43 }; 51 };
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 ASSERT_TRUE(received_value <= kThreadsToRun); 490 ASSERT_TRUE(received_value <= kThreadsToRun);
483 ++received_counts[received_value]; 491 ++received_counts[received_value];
484 } 492 }
485 ASSERT_EQ(received_counts, expected_counts); 493 ASSERT_EQ(received_counts, expected_counts);
486 494
487 message_data_.clear(); 495 message_data_.clear();
488 ASSERT_TRUE(ClearListeners()); 496 ASSERT_TRUE(ClearListeners());
489 497
490 PASS(); 498 PASS();
491 } 499 }
OLDNEW
« no previous file with comments | « chrome/test/ui/ppapi_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698