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

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

Issue 299893002: Fix PPAPINaClNewlibTest.PostMessage flakiness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « chrome/test/ppapi/ppapi_browsertest.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 <string.h> 7 #include <string.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <sstream> 10 #include <sstream>
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 ASSERT_TRUE(message_data_.back().is_bool()); 304 ASSERT_TRUE(message_data_.back().is_bool());
305 if (!message_data_.back().AsBool()) 305 if (!message_data_.back().AsBool())
306 return std::string("Failed: ") + *iter; 306 return std::string("Failed: ") + *iter;
307 ASSERT_TRUE(message_data_.back().AsBool()); 307 ASSERT_TRUE(message_data_.back().AsBool());
308 ASSERT_TRUE(ClearListeners()); 308 ASSERT_TRUE(ClearListeners());
309 } 309 }
310 PASS(); 310 PASS();
311 } 311 }
312 312
313 std::string TestPostMessage::TestSendInInit() { 313 std::string TestPostMessage::TestSendInInit() {
314 ASSERT_EQ(1, WaitForMessages()); 314 // Wait for the messages from Init() to be guaranteed to be sent.
315 WaitForMessages();
315 // This test assumes Init already sent a message. 316 // This test assumes Init already sent a message.
316 ASSERT_EQ(1, message_data_.size()); 317 ASSERT_EQ(1, message_data_.size());
317 ASSERT_TRUE(message_data_.back().is_string()); 318 ASSERT_TRUE(message_data_.back().is_string());
318 ASSERT_EQ(kTestString, message_data_.back().AsString()); 319 ASSERT_EQ(kTestString, message_data_.back().AsString());
319 message_data_.clear(); 320 message_data_.clear();
320 PASS(); 321 PASS();
321 } 322 }
322 323
323 std::string TestPostMessage::TestSendingData() { 324 std::string TestPostMessage::TestSendingData() {
324 // Clean up after previous tests. This also swallows the message sent by Init 325 // Clean up after previous tests. This also swallows the message sent by Init
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 ASSERT_TRUE(received_value <= kThreadsToRun); 901 ASSERT_TRUE(received_value <= kThreadsToRun);
901 ++received_counts[received_value]; 902 ++received_counts[received_value];
902 } 903 }
903 ASSERT_EQ(expected_counts, received_counts); 904 ASSERT_EQ(expected_counts, received_counts);
904 905
905 message_data_.clear(); 906 message_data_.clear();
906 ASSERT_TRUE(ClearListeners()); 907 ASSERT_TRUE(ClearListeners());
907 908
908 PASS(); 909 PASS();
909 } 910 }
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698