Commit cdd86bc9 authored by raymes@chromium.org's avatar raymes@chromium.org

Fix PPAPINaClNewlibTest.PostMessage flakiness

Previously PPAPINaClNewlibTest.PostMessage SendInInit was flaking. The problem seems to be that the messages that are sent in Init() may be replied to and handled in HandleMessage() before RunTests() is run (Init() and RunTests() are called asynchronously). When this is the case, WaitForMessages() can return 0, even though the message from Init() is properly received, because the value of message_data_.size() is 1 before and after the function returns. There is actually no need to check the return value of this function, checking the size of message_data_.size() (which we already do) should be sufficient.

BUG=372630

Review URL: https://codereview.chromium.org/299893002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272542 0039d316-1c4b-4281-b951-d872f2087c98
parent afecfbcc
......@@ -675,16 +675,10 @@ TEST_PPAPI_OUT_OF_PROCESS(MAYBE_VarDeprecated)
#undef PostMessage
#endif
// Flaky: crbug.com/269530
#if defined(OS_WIN)
#define MAYBE_PostMessage DISABLED_PostMessage
#else
#define MAYBE_PostMessage PostMessage
#endif
IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_PostMessage) {
IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, PostMessage) {
RUN_POSTMESSAGE_SUBTESTS;
}
IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PostMessage) {
IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, PostMessage) {
RUN_POSTMESSAGE_SUBTESTS;
}
IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(PostMessage)) {
......
......@@ -311,7 +311,8 @@ std::string TestPostMessage::CheckMessageProperties(
}
std::string TestPostMessage::TestSendInInit() {
ASSERT_EQ(1, WaitForMessages());
// Wait for the messages from Init() to be guaranteed to be sent.
WaitForMessages();
// This test assumes Init already sent a message.
ASSERT_EQ(1, message_data_.size());
ASSERT_TRUE(message_data_.back().is_string());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment