| OLD | NEW |
| 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 Loading... |
| 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 |
| 1491 class GLES2DecoderDoCommandsTest : public GLES2DecoderTest { | 1552 class GLES2DecoderDoCommandsTest : public GLES2DecoderTest { |
| 1492 public: | 1553 public: |
| 1493 GLES2DecoderDoCommandsTest() { | 1554 GLES2DecoderDoCommandsTest() { |
| 1494 for (int i = 0; i < 3; i++) { | 1555 for (int i = 0; i < 3; i++) { |
| 1495 cmds_[i].Init(GL_BLEND); | 1556 cmds_[i].Init(GL_BLEND); |
| 1496 } | 1557 } |
| 1497 entries_per_cmd_ = ComputeNumEntries(cmds_[0].ComputeSize()); | 1558 entries_per_cmd_ = ComputeNumEntries(cmds_[0].ComputeSize()); |
| 1498 } | 1559 } |
| 1499 | 1560 |
| 1500 void SetExpectationsForNCommands(int num_commands) { | 1561 void SetExpectationsForNCommands(int num_commands) { |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 ::testing::Bool()); | 1808 ::testing::Bool()); |
| 1748 | 1809 |
| 1749 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); | 1810 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); |
| 1750 | 1811 |
| 1751 INSTANTIATE_TEST_CASE_P(Service, | 1812 INSTANTIATE_TEST_CASE_P(Service, |
| 1752 GLES3DecoderWithESSL3ShaderTest, | 1813 GLES3DecoderWithESSL3ShaderTest, |
| 1753 ::testing::Bool()); | 1814 ::testing::Bool()); |
| 1754 | 1815 |
| 1755 } // namespace gles2 | 1816 } // namespace gles2 |
| 1756 } // namespace gpu | 1817 } // namespace gpu |
| OLD | NEW |