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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 2410343002: [Reland] Add gl tests to make sure when a buffer is unmapped, all access path generates an INVALID_… (Closed)
Patch Set: Skip the test if context creation fails. Created 4 years, 2 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 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 1481
1482 TEST_P(GLES2DecoderTest, LoseContextCHROMIUMInvalidArgs1_0) { 1482 TEST_P(GLES2DecoderTest, LoseContextCHROMIUMInvalidArgs1_0) {
1483 EXPECT_CALL(*mock_decoder_, MarkContextLost(_)) 1483 EXPECT_CALL(*mock_decoder_, MarkContextLost(_))
1484 .Times(0); 1484 .Times(0);
1485 LoseContextCHROMIUM cmd; 1485 LoseContextCHROMIUM cmd;
1486 cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_NONE); 1486 cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_NONE);
1487 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1487 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1488 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 1488 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
1489 } 1489 }
1490 1490
1491 TEST_P(GLES3DecoderTest, TransformFeedbackStates) {
1492 BeginTransformFeedback begin_cmd;
1493 begin_cmd.Init(GL_POINTS);
1494 EndTransformFeedback end_cmd;
1495 end_cmd.Init();
1496 PauseTransformFeedback pause_cmd;
1497 pause_cmd.Init();
1498 ResumeTransformFeedback resume_cmd;
1499 resume_cmd.Init();
1500
1501 // Before Begin: Pause, Resume, and End is invalid.
1502 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
1503 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
1504
1505 EXPECT_EQ(error::kNoError, ExecuteCmd(pause_cmd));
1506 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
1507
1508 EXPECT_EQ(error::kNoError, ExecuteCmd(resume_cmd));
1509 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
1510
1511 // Begin
1512 EXPECT_CALL(*gl_, BeginTransformFeedback(GL_POINTS))
1513 .Times(1)
1514 .RetiresOnSaturation();
1515 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
1516 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1517
1518 // Begin again is invalid.
1519 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
1520 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
1521
1522 // Before Pause: Resume is invalid.
1523 EXPECT_EQ(error::kNoError, ExecuteCmd(resume_cmd));
1524 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
1525
1526 // Pause
1527 EXPECT_CALL(*gl_, PauseTransformFeedback())
1528 .Times(1)
1529 .RetiresOnSaturation();
1530 EXPECT_EQ(error::kNoError, ExecuteCmd(pause_cmd));
1531 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1532
1533 // Pause again is invalid.
1534 EXPECT_EQ(error::kNoError, ExecuteCmd(pause_cmd));
1535 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
1536
1537 // Resume
1538 EXPECT_CALL(*gl_, ResumeTransformFeedback())
1539 .Times(1)
1540 .RetiresOnSaturation();
1541 EXPECT_EQ(error::kNoError, ExecuteCmd(resume_cmd));
1542 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1543
1544 // End
1545 EXPECT_CALL(*gl_, EndTransformFeedback())
1546 .Times(1)
1547 .RetiresOnSaturation();
1548 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
1549 EXPECT_EQ(GL_NO_ERROR, GetGLError());
1550 }
1551
1552 class GLES2DecoderDoCommandsTest : public GLES2DecoderTest { 1491 class GLES2DecoderDoCommandsTest : public GLES2DecoderTest {
1553 public: 1492 public:
1554 GLES2DecoderDoCommandsTest() { 1493 GLES2DecoderDoCommandsTest() {
1555 for (int i = 0; i < 3; i++) { 1494 for (int i = 0; i < 3; i++) {
1556 cmds_[i].Init(GL_BLEND); 1495 cmds_[i].Init(GL_BLEND);
1557 } 1496 }
1558 entries_per_cmd_ = ComputeNumEntries(cmds_[0].ComputeSize()); 1497 entries_per_cmd_ = ComputeNumEntries(cmds_[0].ComputeSize());
1559 } 1498 }
1560 1499
1561 void SetExpectationsForNCommands(int num_commands) { 1500 void SetExpectationsForNCommands(int num_commands) {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 ::testing::Bool()); 1747 ::testing::Bool());
1809 1748
1810 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); 1749 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool());
1811 1750
1812 INSTANTIATE_TEST_CASE_P(Service, 1751 INSTANTIATE_TEST_CASE_P(Service,
1813 GLES3DecoderWithESSL3ShaderTest, 1752 GLES3DecoderWithESSL3ShaderTest,
1814 ::testing::Bool()); 1753 ::testing::Bool());
1815 1754
1816 } // namespace gles2 1755 } // namespace gles2
1817 } // namespace gpu 1756 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/program_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698