OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "ThrottledTextureUploader.h" | 7 #include "ThrottledTextureUploader.h" |
8 | 8 |
9 #include "CCPrioritizedTexture.h" | 9 #include "CCPrioritizedTexture.h" |
10 #include "Extensions3DChromium.h" | |
11 #include "FakeWebGraphicsContext3D.h" | 10 #include "FakeWebGraphicsContext3D.h" |
12 #include "GraphicsContext3D.h" | 11 #include "third_party/khronos/GLES2/gl2ext.h" |
13 | 12 #include "third_party/khronos/GLES2/gl2.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "FakeWebGraphicsContext3D.h" |
16 #include <wtf/RefPtr.h> | 16 #include <wtf/RefPtr.h> |
17 | 17 |
18 using namespace cc; | 18 using namespace cc; |
19 using namespace WebKit; | 19 using namespace WebKit; |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class FakeWebGraphicsContext3DWithQueryTesting : public FakeWebGraphicsContext3D
{ | 23 class FakeWebGraphicsContext3DWithQueryTesting : public FakeWebGraphicsContext3D
{ |
24 public: | 24 public: |
25 FakeWebGraphicsContext3DWithQueryTesting() : m_resultAvailable(0) | 25 FakeWebGraphicsContext3DWithQueryTesting() : m_resultAvailable(0) |
26 { | 26 { |
27 } | 27 } |
28 | 28 |
29 virtual void getQueryObjectuivEXT(WebGLId, GC3Denum type, GC3Duint* value) | 29 virtual void getQueryObjectuivEXT(WebGLId, WGC3Denum type, WGC3Duint* value) |
30 { | 30 { |
31 switch (type) { | 31 switch (type) { |
32 case Extensions3DChromium::QUERY_RESULT_AVAILABLE_EXT: | 32 case GL_QUERY_RESULT_AVAILABLE_EXT: |
33 *value = m_resultAvailable; | 33 *value = m_resultAvailable; |
34 break; | 34 break; |
35 default: | 35 default: |
36 *value = 0; | 36 *value = 0; |
37 break; | 37 break; |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 void setResultAvailable(unsigned resultAvailable) { m_resultAvailable = resu
ltAvailable; } | 41 void setResultAvailable(unsigned resultAvailable) { m_resultAvailable = resu
ltAvailable; } |
42 | 42 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 EXPECT_EQ(1, uploader->numBlockingUploads()); | 101 EXPECT_EQ(1, uploader->numBlockingUploads()); |
102 | 102 |
103 fakeContext->setResultAvailable(1); | 103 fakeContext->setResultAvailable(1); |
104 EXPECT_EQ(0, uploader->numBlockingUploads()); | 104 EXPECT_EQ(0, uploader->numBlockingUploads()); |
105 uploader->uploadTexture(NULL, upload); | 105 uploader->uploadTexture(NULL, upload); |
106 uploader->markPendingUploadsAsNonBlocking(); | 106 uploader->markPendingUploadsAsNonBlocking(); |
107 EXPECT_EQ(0, uploader->numBlockingUploads()); | 107 EXPECT_EQ(0, uploader->numBlockingUploads()); |
108 } | 108 } |
109 | 109 |
110 } // namespace | 110 } // namespace |
OLD | NEW |