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

Unified Diff: gpu/command_buffer/client/query_tracker_unittest.cc

Issue 1131913004: More compact representation of the GL Query cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: And unittest Created 5 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/client/query_tracker.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/client/query_tracker_unittest.cc
diff --git a/gpu/command_buffer/client/query_tracker_unittest.cc b/gpu/command_buffer/client/query_tracker_unittest.cc
index f6f48ecef2a70e93105827d063e77988d81fd29a..8446608d282a1172c6f0d6ef14d3558bbdf8883e 100644
--- a/gpu/command_buffer/client/query_tracker_unittest.cc
+++ b/gpu/command_buffer/client/query_tracker_unittest.cc
@@ -107,6 +107,10 @@ class QueryTrackerTest : public testing::Test {
return query->info_.bucket;
}
+ uint32 GetBucketUsedCount(QuerySyncManager::Bucket* bucket) {
+ return QuerySyncManager::kSyncsPerBucket - bucket->free_queries.size();
+ }
+
uint32 GetFlushGeneration() { return helper_->flush_generation(); }
scoped_ptr<CommandBuffer> command_buffer_;
@@ -209,7 +213,7 @@ TEST_F(QueryTrackerTest, Remove) {
ASSERT_TRUE(query != NULL);
QuerySyncManager::Bucket* bucket = GetBucket(query);
- EXPECT_EQ(1u, bucket->used_query_count);
+ EXPECT_EQ(1u, GetBucketUsedCount(bucket));
query->MarkAsActive();
query->MarkAsPending(kToken);
@@ -219,7 +223,7 @@ TEST_F(QueryTrackerTest, Remove) {
EXPECT_TRUE(query_tracker_->GetQuery(kId1) == NULL);
// Check that memory was not freed.
- EXPECT_EQ(1u, bucket->used_query_count);
+ EXPECT_EQ(1u, GetBucketUsedCount(bucket));
// Simulate GPU process marking it as available.
QuerySync* sync = GetSync(query);
@@ -228,7 +232,7 @@ TEST_F(QueryTrackerTest, Remove) {
// Check FreeCompletedQueries.
query_tracker_->FreeCompletedQueries();
- EXPECT_EQ(0u, bucket->used_query_count);
+ EXPECT_EQ(0u, GetBucketUsedCount(bucket));
}
} // namespace gles2
« no previous file with comments | « gpu/command_buffer/client/query_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698