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

Side by Side Diff: gpu/command_buffer/tests/gl_get_error_query_unittests.cc

Issue 10577037: Add GL_CHROMIUM_get_error_query (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/service/query_manager_unittest.cc ('k') | gpu/command_buffer_client.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h>
7
8 #include "gpu/command_buffer/tests/gl_manager.h"
9 #include "gpu/command_buffer/tests/gl_test_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace gpu {
14
15 class GetErrorQueryTest : public testing::Test {
16 protected:
17 virtual void SetUp() {
18 gl_.Initialize(gfx::Size(2, 2));
19 }
20
21 virtual void TearDown() {
22 gl_.Destroy();
23 }
24
25 GLManager gl_;
26 };
27
28 TEST_F(GetErrorQueryTest, Basic) {
29 EXPECT_TRUE(GLTestHelper::HasExtension("GL_CHROMIUM_get_error_query"));
30
31 GLuint query = 0;
32 glGenQueriesEXT(1, &query);
33
34 GLuint query_status = 0;
35 GLuint result = 0;
36
37 glBeginQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM, query);
38 glEnable(GL_TEXTURE_2D); // Generates an INVALID_ENUM error
39 glEndQueryEXT(GL_GET_ERROR_QUERY_CHROMIUM);
40
41 glFinish();
42
43 query_status = 0;
44 result = 0;
45 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result);
46 EXPECT_TRUE(result);
47 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status);
48 EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status);
49 }
50
51 } // namespace gpu
52
53
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/query_manager_unittest.cc ('k') | gpu/command_buffer_client.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698