| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // These tests are run twice: | 5 // These tests are run twice: |
| 6 // Once in a gpu test with an in-process WebGraphicsContext3D. | 6 // Once in a gpu test with an in-process WebGraphicsContext3D. |
| 7 // Once in a browsertest with a gpu-process WebGraphicsContext3D. | 7 // Once in a browsertest with a gpu-process WebGraphicsContext3D. |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "gpu/GLES2/gl2extchromium.h" | 11 #include "gpu/GLES2/gl2extchromium.h" |
| 12 #include "gpu/command_buffer/client/context_support.h" | 12 #include "gpu/command_buffer/client/context_support.h" |
| 13 #include "gpu/command_buffer/client/gles2_interface.h" |
| 13 #include "gpu/command_buffer/common/sync_token.h" | 14 #include "gpu/command_buffer/common/sync_token.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 class SignalTest : public ContextTestBase { | 18 class SignalTest : public ContextTestBase { |
| 18 public: | 19 public: |
| 19 static void RunOnlyOnce(base::Closure cb, int* tmp) { | 20 static void RunOnlyOnce(base::Closure cb, int* tmp) { |
| 20 CHECK_EQ(*tmp, 0); | 21 CHECK_EQ(*tmp, 0); |
| 21 ++*tmp; | 22 ++*tmp; |
| 22 cb.Run(); | 23 cb.Run(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 38 &RunOnlyOnce, run_loop.QuitClosure(), base::Owned(new int(0)))); | 39 &RunOnlyOnce, run_loop.QuitClosure(), base::Owned(new int(0)))); |
| 39 run_loop.Run(); | 40 run_loop.Run(); |
| 40 } | 41 } |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 CONTEXT_TEST_F(SignalTest, BasicSignalSyncTokenTest) { | 44 CONTEXT_TEST_F(SignalTest, BasicSignalSyncTokenTest) { |
| 44 if (!context_) | 45 if (!context_) |
| 45 return; | 46 return; |
| 46 | 47 |
| 47 const blink::WGC3Duint64 fence_sync = context_->insertFenceSyncCHROMIUM(); | 48 const blink::WGC3Duint64 fence_sync = context_->insertFenceSyncCHROMIUM(); |
| 48 context_->shallowFlushCHROMIUM(); | 49 context_->GetGLInterface()->ShallowFlushCHROMIUM(); |
| 49 | 50 |
| 50 gpu::SyncToken sync_token; | 51 gpu::SyncToken sync_token; |
| 51 ASSERT_TRUE(context_->genSyncTokenCHROMIUM(fence_sync, sync_token.GetData())); | 52 ASSERT_TRUE(context_->genSyncTokenCHROMIUM(fence_sync, sync_token.GetData())); |
| 52 | 53 |
| 53 TestSignalSyncToken(sync_token); | 54 TestSignalSyncToken(sync_token); |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 CONTEXT_TEST_F(SignalTest, EmptySignalSyncTokenTest) { | 57 CONTEXT_TEST_F(SignalTest, EmptySignalSyncTokenTest) { |
| 57 if (!context_) | 58 if (!context_) |
| 58 return; | 59 return; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // immediately. | 105 // immediately. |
| 105 TestSignalQuery(928729087); | 106 TestSignalQuery(928729087); |
| 106 TestSignalQuery(928729086); | 107 TestSignalQuery(928729086); |
| 107 TestSignalQuery(928729085); | 108 TestSignalQuery(928729085); |
| 108 TestSignalQuery(928729083); | 109 TestSignalQuery(928729083); |
| 109 TestSignalQuery(928729082); | 110 TestSignalQuery(928729082); |
| 110 TestSignalQuery(928729081); | 111 TestSignalQuery(928729081); |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 }; | 114 }; |
| OLD | NEW |