| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 // These tests should time out if the callback doesn't get called. | 24 // These tests should time out if the callback doesn't get called. |
| 25 void TestSignalSyncPoint(unsigned sync_point) { | 25 void TestSignalSyncPoint(unsigned sync_point) { |
| 26 base::RunLoop run_loop; | 26 base::RunLoop run_loop; |
| 27 context_support_->SignalSyncPoint(sync_point, run_loop.QuitClosure()); | 27 context_support_->SignalSyncPoint(sync_point, run_loop.QuitClosure()); |
| 28 run_loop.Run(); | 28 run_loop.Run(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 // These tests should time out if the callback doesn't get called. | 31 // These tests should time out if the callback doesn't get called. |
| 32 void TestSignalQuery(WebKit::WebGLId query) { | 32 void TestSignalQuery(blink::WebGLId query) { |
| 33 base::RunLoop run_loop; | 33 base::RunLoop run_loop; |
| 34 context_support_->SignalQuery( | 34 context_support_->SignalQuery( |
| 35 query, | 35 query, |
| 36 base::Bind( | 36 base::Bind( |
| 37 &RunOnlyOnce, run_loop.QuitClosure(), base::Owned(new int(0)))); | 37 &RunOnlyOnce, run_loop.QuitClosure(), base::Owned(new int(0)))); |
| 38 run_loop.Run(); | 38 run_loop.Run(); |
| 39 } | 39 } |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 CONTEXT_TEST_F(SignalTest, BasicSignalSyncPointTest) { | 42 CONTEXT_TEST_F(SignalTest, BasicSignalSyncPointTest) { |
| 43 TestSignalSyncPoint(context_->insertSyncPoint()); | 43 TestSignalSyncPoint(context_->insertSyncPoint()); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 CONTEXT_TEST_F(SignalTest, InvalidSignalSyncPointTest) { | 46 CONTEXT_TEST_F(SignalTest, InvalidSignalSyncPointTest) { |
| 47 // Signalling something that doesn't exist should run the callback | 47 // Signalling something that doesn't exist should run the callback |
| 48 // immediately. | 48 // immediately. |
| 49 TestSignalSyncPoint(1297824234); | 49 TestSignalSyncPoint(1297824234); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 CONTEXT_TEST_F(SignalTest, BasicSignalQueryTest) { | 52 CONTEXT_TEST_F(SignalTest, BasicSignalQueryTest) { |
| 53 unsigned query = context_->createQueryEXT(); | 53 unsigned query = context_->createQueryEXT(); |
| 54 context_->beginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, query); | 54 context_->beginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, query); |
| 55 context_->finish(); | 55 context_->finish(); |
| 56 context_->endQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); | 56 context_->endQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); |
| 57 TestSignalQuery(query); | 57 TestSignalQuery(query); |
| 58 context_->deleteQueryEXT(query); | 58 context_->deleteQueryEXT(query); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 CONTEXT_TEST_F(SignalTest, SignalQueryUnboundTest) { | 61 CONTEXT_TEST_F(SignalTest, SignalQueryUnboundTest) { |
| 62 WebKit::WebGLId query = context_->createQueryEXT(); | 62 blink::WebGLId query = context_->createQueryEXT(); |
| 63 TestSignalQuery(query); | 63 TestSignalQuery(query); |
| 64 context_->deleteQueryEXT(query); | 64 context_->deleteQueryEXT(query); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 CONTEXT_TEST_F(SignalTest, InvalidSignalQueryUnboundTest) { | 67 CONTEXT_TEST_F(SignalTest, InvalidSignalQueryUnboundTest) { |
| 68 // Signalling something that doesn't exist should run the callback | 68 // Signalling something that doesn't exist should run the callback |
| 69 // immediately. | 69 // immediately. |
| 70 TestSignalQuery(928729087); | 70 TestSignalQuery(928729087); |
| 71 TestSignalQuery(928729086); | 71 TestSignalQuery(928729086); |
| 72 TestSignalQuery(928729085); | 72 TestSignalQuery(928729085); |
| 73 TestSignalQuery(928729083); | 73 TestSignalQuery(928729083); |
| 74 TestSignalQuery(928729082); | 74 TestSignalQuery(928729082); |
| 75 TestSignalQuery(928729081); | 75 TestSignalQuery(928729081); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 }; | 78 }; |
| OLD | NEW |