Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: cc/throttled_texture_uploader_unittest.cc

Issue 11183006: cc: Remove wtf includes from resource provider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/throttled_texture_uploader.cc ('k') | cc/tiled_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/throttled_texture_uploader.h" 7 #include "cc/throttled_texture_uploader.h"
8 8
9 #include "CCPrioritizedTexture.h" 9 #include "CCPrioritizedTexture.h"
10 #include "Extensions3DChromium.h" 10 #include "Extensions3DChromium.h"
(...skipping 29 matching lines...) Expand all
40 void setResultAvailable(unsigned resultAvailable) { m_resultAvailable = resu ltAvailable; } 40 void setResultAvailable(unsigned resultAvailable) { m_resultAvailable = resu ltAvailable; }
41 41
42 private: 42 private:
43 unsigned m_resultAvailable; 43 unsigned m_resultAvailable;
44 }; 44 };
45 45
46 46
47 TEST(ThrottledTextureUploaderTest, NumBlockingUploads) 47 TEST(ThrottledTextureUploaderTest, NumBlockingUploads)
48 { 48 {
49 OwnPtr<FakeWebGraphicsContext3DWithQueryTesting> fakeContext(adoptPtr(new Fa keWebGraphicsContext3DWithQueryTesting)); 49 OwnPtr<FakeWebGraphicsContext3DWithQueryTesting> fakeContext(adoptPtr(new Fa keWebGraphicsContext3DWithQueryTesting));
50 OwnPtr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::create (fakeContext.get()); 50 scoped_ptr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::cr eate(fakeContext.get());
51 scoped_ptr<CCPrioritizedTexture> texture = 51 scoped_ptr<CCPrioritizedTexture> texture =
52 CCPrioritizedTexture::create(NULL, IntSize(256, 256), GL_RGBA); 52 CCPrioritizedTexture::create(NULL, IntSize(256, 256), GL_RGBA);
53 TextureUploader::Parameters upload; 53 TextureUploader::Parameters upload;
54 upload.texture = texture.get(); 54 upload.texture = texture.get();
55 upload.bitmap = NULL; 55 upload.bitmap = NULL;
56 upload.picture = NULL; 56 upload.picture = NULL;
57 upload.geometry.contentRect = IntRect(IntPoint(0,0), texture->size()); 57 upload.geometry.contentRect = IntRect(IntPoint(0,0), texture->size());
58 upload.geometry.sourceRect = IntRect(IntPoint(0,0), texture->size()); 58 upload.geometry.sourceRect = IntRect(IntPoint(0,0), texture->size());
59 upload.geometry.destOffset = IntSize(); 59 upload.geometry.destOffset = IntSize();
60 60
61 fakeContext->setResultAvailable(0); 61 fakeContext->setResultAvailable(0);
62 EXPECT_EQ(0, uploader->numBlockingUploads()); 62 EXPECT_EQ(0, uploader->numBlockingUploads());
63 uploader->uploadTexture(NULL, upload); 63 uploader->uploadTexture(NULL, upload);
64 EXPECT_EQ(1, uploader->numBlockingUploads()); 64 EXPECT_EQ(1, uploader->numBlockingUploads());
65 uploader->uploadTexture(NULL, upload); 65 uploader->uploadTexture(NULL, upload);
66 EXPECT_EQ(2, uploader->numBlockingUploads()); 66 EXPECT_EQ(2, uploader->numBlockingUploads());
67 67
68 fakeContext->setResultAvailable(1); 68 fakeContext->setResultAvailable(1);
69 EXPECT_EQ(0, uploader->numBlockingUploads()); 69 EXPECT_EQ(0, uploader->numBlockingUploads());
70 uploader->uploadTexture(NULL, upload); 70 uploader->uploadTexture(NULL, upload);
71 EXPECT_EQ(0, uploader->numBlockingUploads()); 71 EXPECT_EQ(0, uploader->numBlockingUploads());
72 uploader->uploadTexture(NULL, upload); 72 uploader->uploadTexture(NULL, upload);
73 uploader->uploadTexture(NULL, upload); 73 uploader->uploadTexture(NULL, upload);
74 EXPECT_EQ(0, uploader->numBlockingUploads()); 74 EXPECT_EQ(0, uploader->numBlockingUploads());
75 } 75 }
76 76
77 TEST(ThrottledTextureUploaderTest, MarkPendingUploadsAsNonBlocking) 77 TEST(ThrottledTextureUploaderTest, MarkPendingUploadsAsNonBlocking)
78 { 78 {
79 OwnPtr<FakeWebGraphicsContext3DWithQueryTesting> fakeContext(adoptPtr(new Fa keWebGraphicsContext3DWithQueryTesting)); 79 OwnPtr<FakeWebGraphicsContext3DWithQueryTesting> fakeContext(adoptPtr(new Fa keWebGraphicsContext3DWithQueryTesting));
80 OwnPtr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::create (fakeContext.get()); 80 scoped_ptr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::cr eate(fakeContext.get());
81 scoped_ptr<CCPrioritizedTexture> texture = 81 scoped_ptr<CCPrioritizedTexture> texture =
82 CCPrioritizedTexture::create(NULL, IntSize(256, 256), GL_RGBA); 82 CCPrioritizedTexture::create(NULL, IntSize(256, 256), GL_RGBA);
83 TextureUploader::Parameters upload; 83 TextureUploader::Parameters upload;
84 upload.texture = texture.get(); 84 upload.texture = texture.get();
85 upload.bitmap = NULL; 85 upload.bitmap = NULL;
86 upload.picture = NULL; 86 upload.picture = NULL;
87 upload.geometry.contentRect = IntRect(IntPoint(0,0), texture->size()); 87 upload.geometry.contentRect = IntRect(IntPoint(0,0), texture->size());
88 upload.geometry.sourceRect = IntRect(IntPoint(0,0), texture->size()); 88 upload.geometry.sourceRect = IntRect(IntPoint(0,0), texture->size());
89 upload.geometry.destOffset = IntSize(); 89 upload.geometry.destOffset = IntSize();
90 90
91 fakeContext->setResultAvailable(0); 91 fakeContext->setResultAvailable(0);
92 EXPECT_EQ(0, uploader->numBlockingUploads()); 92 EXPECT_EQ(0, uploader->numBlockingUploads());
93 uploader->uploadTexture(NULL, upload); 93 uploader->uploadTexture(NULL, upload);
94 uploader->uploadTexture(NULL, upload); 94 uploader->uploadTexture(NULL, upload);
95 EXPECT_EQ(2, uploader->numBlockingUploads()); 95 EXPECT_EQ(2, uploader->numBlockingUploads());
96 96
97 uploader->markPendingUploadsAsNonBlocking(); 97 uploader->markPendingUploadsAsNonBlocking();
98 EXPECT_EQ(0, uploader->numBlockingUploads()); 98 EXPECT_EQ(0, uploader->numBlockingUploads());
99 uploader->uploadTexture(NULL, upload); 99 uploader->uploadTexture(NULL, upload);
100 EXPECT_EQ(1, uploader->numBlockingUploads()); 100 EXPECT_EQ(1, uploader->numBlockingUploads());
101 101
102 fakeContext->setResultAvailable(1); 102 fakeContext->setResultAvailable(1);
103 EXPECT_EQ(0, uploader->numBlockingUploads()); 103 EXPECT_EQ(0, uploader->numBlockingUploads());
104 uploader->uploadTexture(NULL, upload); 104 uploader->uploadTexture(NULL, upload);
105 uploader->markPendingUploadsAsNonBlocking(); 105 uploader->markPendingUploadsAsNonBlocking();
106 EXPECT_EQ(0, uploader->numBlockingUploads()); 106 EXPECT_EQ(0, uploader->numBlockingUploads());
107 } 107 }
108 108
109 } // namespace 109 } // namespace
OLDNEW
« no previous file with comments | « cc/throttled_texture_uploader.cc ('k') | cc/tiled_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698