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

Side by Side Diff: gpu/command_buffer/client/query_tracker_unittest.cc

Issue 10837105: Adjust Query code to handle context lost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/client/query_tracker.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 // Tests for the QueryTracker. 5 // Tests for the QueryTracker.
6 6
7 #include "gpu/command_buffer/client/query_tracker.h" 7 #include "gpu/command_buffer/client/query_tracker.h"
8 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 // Check we can create a Query. 109 // Check we can create a Query.
110 QueryTracker::Query* query = query_tracker_->CreateQuery( 110 QueryTracker::Query* query = query_tracker_->CreateQuery(
111 kId1, GL_ANY_SAMPLES_PASSED_EXT); 111 kId1, GL_ANY_SAMPLES_PASSED_EXT);
112 ASSERT_TRUE(query != NULL); 112 ASSERT_TRUE(query != NULL);
113 // Check we can get the same Query. 113 // Check we can get the same Query.
114 EXPECT_EQ(query, query_tracker_->GetQuery(kId1)); 114 EXPECT_EQ(query, query_tracker_->GetQuery(kId1));
115 // Check we get nothing for a non-existent query. 115 // Check we get nothing for a non-existent query.
116 EXPECT_TRUE(query_tracker_->GetQuery(kId2) == NULL); 116 EXPECT_TRUE(query_tracker_->GetQuery(kId2) == NULL);
117 // Check we can delete the query. 117 // Check we can delete the query.
118 query_tracker_->RemoveQuery(kId1); 118 query_tracker_->RemoveQuery(kId1, false);
119 // Check we get nothing for a non-existent query. 119 // Check we get nothing for a non-existent query.
120 EXPECT_TRUE(query_tracker_->GetQuery(kId1) == NULL); 120 EXPECT_TRUE(query_tracker_->GetQuery(kId1) == NULL);
121 } 121 }
122 122
123 TEST_F(QueryTrackerTest, Query) { 123 TEST_F(QueryTrackerTest, Query) {
124 const GLuint kId1 = 123; 124 const GLuint kId1 = 123;
125 const int32 kToken = 46; 125 const int32 kToken = 46;
126 const uint32 kResult = 456; 126 const uint32 kResult = 456;
127 127
128 // Create a Query. 128 // Create a Query.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 EXPECT_TRUE(query->CheckResultsAvailable(helper_.get())); 162 EXPECT_TRUE(query->CheckResultsAvailable(helper_.get()));
163 EXPECT_EQ(kResult, query->GetResult()); 163 EXPECT_EQ(kResult, query->GetResult());
164 EXPECT_FALSE(query->NeverUsed()); 164 EXPECT_FALSE(query->NeverUsed());
165 EXPECT_FALSE(query->Pending()); 165 EXPECT_FALSE(query->Pending());
166 } 166 }
167 167
168 } // namespace gles2 168 } // namespace gles2
169 } // namespace gpu 169 } // namespace gpu
170 170
171 171
OLDNEW
« 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