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

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

Issue 2602563002: Refactor DrawTextureQuad and CheckPixels in gl_tests util (Closed)
Patch Set: rebase only Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 gl1a_.MakeCurrent(); 49 gl1a_.MakeCurrent();
50 glLoseContextCHROMIUM( 50 glLoseContextCHROMIUM(
51 GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_CONTEXT_RESET_EXT); 51 GL_GUILTY_CONTEXT_RESET_EXT, GL_INNOCENT_CONTEXT_RESET_EXT);
52 52
53 uint8_t expected_no_draw[] = { 53 uint8_t expected_no_draw[] = {
54 GLTestHelper::kCheckClearValue, GLTestHelper::kCheckClearValue, 54 GLTestHelper::kCheckClearValue, GLTestHelper::kCheckClearValue,
55 GLTestHelper::kCheckClearValue, GLTestHelper::kCheckClearValue, 55 GLTestHelper::kCheckClearValue, GLTestHelper::kCheckClearValue,
56 }; 56 };
57 // Expect the read will fail. 57 // Expect the read will fail.
58 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); 58 EXPECT_TRUE(
59 GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw, nullptr));
59 gl1b_.MakeCurrent(); 60 gl1b_.MakeCurrent();
60 // Expect the read will fail. 61 // Expect the read will fail.
61 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw)); 62 EXPECT_TRUE(
63 GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_no_draw, nullptr));
62 gl2_.MakeCurrent(); 64 gl2_.MakeCurrent();
63 uint8_t expected_draw[] = { 65 uint8_t expected_draw[] = {
64 0, 0, 0, 0, 66 0, 0, 0, 0,
65 }; 67 };
66 // Expect the read will succeed. 68 // Expect the read will succeed.
67 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw)); 69 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected_draw, nullptr));
68 } 70 }
69 71
70 } // namespace gpu 72 } // namespace gpu
71 73
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698