Commit 7ffdde31 authored by Christian Fremerey's avatar Christian Fremerey Committed by Commit Bot

Fix video capture unit test making wrong assumption about event ordering

Bug: 872065
Change-Id: If0de2e5cb8470e604bc97f1c3689ae8972888e6c
Reviewed-on: https://chromium-review.googlesource.com/1167968Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581702}
parent 04308f3d
......@@ -79,9 +79,19 @@ TEST_F(TextureVirtualDeviceMojoAdapterTest,
ProducerSharesBufferHandle(kArbitraryBufferId2);
base::RunLoop wait_loop;
EXPECT_CALL(*mock_receiver_1_, DoOnNewBuffer(kArbitraryBufferId1, _));
int buffer_received_count = 0;
EXPECT_CALL(*mock_receiver_1_, DoOnNewBuffer(kArbitraryBufferId1, _))
.WillOnce(InvokeWithoutArgs([&wait_loop, &buffer_received_count]() {
buffer_received_count++;
if (buffer_received_count == 2)
wait_loop.Quit();
}));
EXPECT_CALL(*mock_receiver_1_, DoOnNewBuffer(kArbitraryBufferId2, _))
.WillOnce(InvokeWithoutArgs([&wait_loop]() { wait_loop.Quit(); }));
.WillOnce(InvokeWithoutArgs([&wait_loop, &buffer_received_count]() {
buffer_received_count++;
if (buffer_received_count == 2)
wait_loop.Quit();
}));
Receiver1Connects();
wait_loop.Run();
}
......
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