| 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 // 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 <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 4469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4480 .WillOnce(SaveArg<1>(&signal_closure)); | 4480 .WillOnce(SaveArg<1>(&signal_closure)); |
| 4481 gl_->SignalSyncToken(sync_token, base::Bind(&CountCallback, &signaled_count)); | 4481 gl_->SignalSyncToken(sync_token, base::Bind(&CountCallback, &signaled_count)); |
| 4482 EXPECT_EQ(0, signaled_count); | 4482 EXPECT_EQ(0, signaled_count); |
| 4483 | 4483 |
| 4484 // When GpuControl runs the callback, the original callback we gave to | 4484 // When GpuControl runs the callback, the original callback we gave to |
| 4485 // GLES2Implementation is run. | 4485 // GLES2Implementation is run. |
| 4486 signal_closure.Run(); | 4486 signal_closure.Run(); |
| 4487 EXPECT_EQ(1, signaled_count); | 4487 EXPECT_EQ(1, signaled_count); |
| 4488 } | 4488 } |
| 4489 | 4489 |
| 4490 TEST_F(GLES2ImplementationTest, SignalSyncTokenAfterContextLoss) { | 4490 // TODO(danakj): Re-enable after/during re-land of https://crrev.com/389947. |
| 4491 // This test depends on r389947 but that CL was reverted in r389980. |
| 4492 TEST_F(GLES2ImplementationTest, DISABLED_SignalSyncTokenAfterContextLoss) { |
| 4491 EXPECT_CALL(*gpu_control_, GenerateFenceSyncRelease()).WillOnce(Return(1)); | 4493 EXPECT_CALL(*gpu_control_, GenerateFenceSyncRelease()).WillOnce(Return(1)); |
| 4492 const uint64_t fence_sync = gl_->InsertFenceSyncCHROMIUM(); | 4494 const uint64_t fence_sync = gl_->InsertFenceSyncCHROMIUM(); |
| 4493 gl_->ShallowFlushCHROMIUM(); | 4495 gl_->ShallowFlushCHROMIUM(); |
| 4494 | 4496 |
| 4495 EXPECT_CALL(*gpu_control_, IsFenceSyncRelease(fence_sync)) | 4497 EXPECT_CALL(*gpu_control_, IsFenceSyncRelease(fence_sync)) |
| 4496 .WillOnce(Return(true)); | 4498 .WillOnce(Return(true)); |
| 4497 EXPECT_CALL(*gpu_control_, IsFenceSyncFlushReceived(fence_sync)) | 4499 EXPECT_CALL(*gpu_control_, IsFenceSyncFlushReceived(fence_sync)) |
| 4498 .WillOnce(Return(true)); | 4500 .WillOnce(Return(true)); |
| 4499 EXPECT_CALL(*gpu_control_, GetNamespaceID()).WillOnce(Return(GPU_IO)); | 4501 EXPECT_CALL(*gpu_control_, GetNamespaceID()).WillOnce(Return(GPU_IO)); |
| 4500 EXPECT_CALL(*gpu_control_, GetExtraCommandBufferData()).WillOnce(Return(0)); | 4502 EXPECT_CALL(*gpu_control_, GetExtraCommandBufferData()).WillOnce(Return(0)); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4579 ContextInitOptions init_options; | 4581 ContextInitOptions init_options; |
| 4580 init_options.transfer_buffer_initialize_fail = true; | 4582 init_options.transfer_buffer_initialize_fail = true; |
| 4581 EXPECT_FALSE(Initialize(init_options)); | 4583 EXPECT_FALSE(Initialize(init_options)); |
| 4582 } | 4584 } |
| 4583 | 4585 |
| 4584 #include "base/macros.h" | 4586 #include "base/macros.h" |
| 4585 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 4587 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
| 4586 | 4588 |
| 4587 } // namespace gles2 | 4589 } // namespace gles2 |
| 4588 } // namespace gpu | 4590 } // namespace gpu |
| OLD | NEW |