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

Unified Diff: gpu/command_buffer/service/sync_point_manager_unittest.cc

Issue 1975663002: Invalid sync token waits now automatically get released. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Combine the 2 while loops into 1 Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/sync_point_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/sync_point_manager_unittest.cc
diff --git a/gpu/command_buffer/service/sync_point_manager_unittest.cc b/gpu/command_buffer/service/sync_point_manager_unittest.cc
index 52371a5dfcd7a99d65e6b19393ba07cbe49c6057..a9f6c56b8780f3c987ef76a6e9d24a2868a7b056 100644
--- a/gpu/command_buffer/service/sync_point_manager_unittest.cc
+++ b/gpu/command_buffer/service/sync_point_manager_unittest.cc
@@ -381,13 +381,21 @@ TEST_F(SyncPointManagerTest, NonExistentRelease2) {
EXPECT_EQ(10, test_num);
// Even though release stream order [1] did not have a release, it
- // should still release the fence when finish processing since the wait
- // stream had expected on to exist there.
+ // should have changed test_num although the fence sync is still not released.
release_stream.BeginProcessing();
ASSERT_EQ(1u, release_stream.order_data->current_order_num());
release_stream.EndProcessing();
- EXPECT_TRUE(release_stream.client->client_state()->IsFenceSyncReleased(1));
+ EXPECT_FALSE(release_stream.client->client_state()->IsFenceSyncReleased(1));
EXPECT_EQ(123, test_num);
+
+ // Ensure that the wait callback does not get triggered again when it is
+ // actually released.
+ test_num = 1;
+ release_stream.AllocateOrderNum(sync_point_manager_.get());
+ release_stream.BeginProcessing();
+ release_stream.client->ReleaseFenceSync(1);
+ release_stream.EndProcessing();
+ EXPECT_EQ(1, test_num);
}
TEST_F(SyncPointManagerTest, NonExistentOrderNumRelease) {
@@ -433,11 +441,18 @@ TEST_F(SyncPointManagerTest, NonExistentOrderNumRelease) {
EXPECT_FALSE(release_stream.client->client_state()->IsFenceSyncReleased(1));
EXPECT_EQ(10, test_num);
- // Beginning order [4] should immediately trigger the release.
+ // Beginning order [4] should immediately trigger the wait although the fence
+ // sync is still not released yet.
release_stream.BeginProcessing();
ASSERT_EQ(4u, release_stream.order_data->current_order_num());
- EXPECT_TRUE(release_stream.client->client_state()->IsFenceSyncReleased(1));
+ EXPECT_FALSE(release_stream.client->client_state()->IsFenceSyncReleased(1));
EXPECT_EQ(123, test_num);
+
+ // Ensure that the wait callback does not get triggered again when it is
+ // actually released.
+ test_num = 1;
+ release_stream.client->ReleaseFenceSync(1);
+ EXPECT_EQ(1, test_num);
}
TEST_F(SyncPointManagerTest, OnWaitCallbackTest) {
« no previous file with comments | « gpu/command_buffer/service/sync_point_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698