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

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

Issue 1188013004: Added support for Time Elapsed queries through the command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed ppapi support Created 5 years, 6 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
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 GLES2Implementation. 5 // Tests for GLES2Implementation.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 3299 matching lines...) Expand 10 before | Expand all | Expand 10 after
3310 ClearCommands(); 3310 ClearCommands();
3311 gl_->GetQueryObjectuivEXT(4567, GL_QUERY_RESULT_AVAILABLE_EXT, &available); 3311 gl_->GetQueryObjectuivEXT(4567, GL_QUERY_RESULT_AVAILABLE_EXT, &available);
3312 EXPECT_TRUE(NoCommandsWritten()); 3312 EXPECT_TRUE(NoCommandsWritten());
3313 EXPECT_EQ(0xBDu, available); 3313 EXPECT_EQ(0xBDu, available);
3314 EXPECT_EQ(GL_INVALID_OPERATION, CheckError()); 3314 EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
3315 3315
3316 // Test GetQueryObjectuivEXT CheckResultsAvailable 3316 // Test GetQueryObjectuivEXT CheckResultsAvailable
3317 ClearCommands(); 3317 ClearCommands();
3318 gl_->GetQueryObjectuivEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available); 3318 gl_->GetQueryObjectuivEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available);
3319 EXPECT_EQ(0u, available); 3319 EXPECT_EQ(0u, available);
3320
3321 // Test GetQueryObjectui64vEXT fails if unused id
3322 GLuint64 available2 = 0xBDu;
3323 ClearCommands();
3324 gl_->GetQueryObjectui64vEXT(id2, GL_QUERY_RESULT_AVAILABLE_EXT, &available2);
3325 EXPECT_TRUE(NoCommandsWritten());
3326 EXPECT_EQ(0xBDu, available2);
3327 EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
3328
3329 // Test GetQueryObjectui64vEXT fails if bad id
3330 ClearCommands();
3331 gl_->GetQueryObjectui64vEXT(4567, GL_QUERY_RESULT_AVAILABLE_EXT, &available2);
3332 EXPECT_TRUE(NoCommandsWritten());
3333 EXPECT_EQ(0xBDu, available2);
3334 EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
3335
3336 // Test GetQueryObjectui64vEXT CheckResultsAvailable
3337 ClearCommands();
3338 gl_->GetQueryObjectui64vEXT(id1, GL_QUERY_RESULT_AVAILABLE_EXT, &available2);
3339 EXPECT_EQ(0u, available2);
3320 } 3340 }
3321 3341
3322 TEST_F(GLES2ImplementationTest, ErrorQuery) { 3342 TEST_F(GLES2ImplementationTest, ErrorQuery) {
3323 GLuint id = 0; 3343 GLuint id = 0;
3324 gl_->GenQueriesEXT(1, &id); 3344 gl_->GenQueriesEXT(1, &id);
3325 ClearCommands(); 3345 ClearCommands();
3326 3346
3327 // Test BeginQueryEXT does NOT insert commands. 3347 // Test BeginQueryEXT does NOT insert commands.
3328 gl_->BeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, id); 3348 gl_->BeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, id);
3329 EXPECT_TRUE(NoCommandsWritten()); 3349 EXPECT_TRUE(NoCommandsWritten());
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
3939 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { 3959 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) {
3940 ContextInitOptions init_options; 3960 ContextInitOptions init_options;
3941 init_options.transfer_buffer_initialize_fail = true; 3961 init_options.transfer_buffer_initialize_fail = true;
3942 EXPECT_FALSE(Initialize(init_options)); 3962 EXPECT_FALSE(Initialize(init_options));
3943 } 3963 }
3944 3964
3945 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" 3965 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h"
3946 3966
3947 } // namespace gles2 3967 } // namespace gles2
3948 } // namespace gpu 3968 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698