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

Side by Side Diff: cc/resource_provider_unittest.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 165064 Created 8 years, 1 month 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
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/resource_provider.h" 7 #include "cc/resource_provider.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/graphics_context.h" 10 #include "cc/graphics_context.h"
11 #include "cc/scoped_ptr_deque.h" 11 #include "cc/scoped_ptr_deque.h"
12 #include "cc/scoped_ptr_hash_map.h" 12 #include "cc/scoped_ptr_hash_map.h"
13 #include "cc/single_thread_proxy.h" // For DebugScopedSetImplThread 13 #include "cc/stubs/int_rect.h"
14 #include "cc/test/compositor_fake_web_graphics_context_3d.h" 14 #include "cc/test/compositor_fake_web_graphics_context_3d.h"
15 #include "cc/test/fake_web_compositor_output_surface.h" 15 #include "cc/test/fake_web_compositor_output_surface.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "third_party/khronos/GLES2/gl2.h" 17 #include "third_party/khronos/GLES2/gl2.h"
18 #include "third_party/khronos/GLES2/gl2ext.h" 18 #include "third_party/khronos/GLES2/gl2ext.h"
19 #include <public/WebGraphicsContext3D.h> 19 #include <public/WebGraphicsContext3D.h>
20 20
21 using namespace cc; 21 using namespace cc;
22 using namespace WebKit; 22 using namespace WebKit;
23 23
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 294
295 void expectNumResources(int count) 295 void expectNumResources(int count)
296 { 296 {
297 EXPECT_EQ(count, static_cast<int>(m_resourceProvider->numResources())); 297 EXPECT_EQ(count, static_cast<int>(m_resourceProvider->numResources()));
298 if (GetParam() == ResourceProvider::GLTexture) 298 if (GetParam() == ResourceProvider::GLTexture)
299 EXPECT_EQ(count, context()->textureCount()); 299 EXPECT_EQ(count, context()->textureCount());
300 } 300 }
301 301
302 protected: 302 protected:
303 DebugScopedSetImplThread implThread;
304 scoped_ptr<ContextSharedData> m_sharedData; 303 scoped_ptr<ContextSharedData> m_sharedData;
305 scoped_ptr<GraphicsContext> m_context; 304 scoped_ptr<GraphicsContext> m_context;
306 scoped_ptr<ResourceProvider> m_resourceProvider; 305 scoped_ptr<ResourceProvider> m_resourceProvider;
307 }; 306 };
308 307
309 TEST_P(ResourceProviderTest, Basic) 308 TEST_P(ResourceProviderTest, Basic)
310 { 309 {
311 IntSize size(1, 1); 310 IntSize size(1, 1);
312 WGC3Denum format = GL_RGBA; 311 WGC3Denum format = GL_RGBA;
313 int pool = 1; 312 int pool = 1;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 } 579 }
581 EXPECT_EQ(0u, childResourceProvider->numResources()); 580 EXPECT_EQ(0u, childResourceProvider->numResources());
582 } 581 }
583 582
584 INSTANTIATE_TEST_CASE_P(ResourceProviderTests, 583 INSTANTIATE_TEST_CASE_P(ResourceProviderTests,
585 ResourceProviderTest, 584 ResourceProviderTest,
586 ::testing::Values(ResourceProvider::GLTexture, 585 ::testing::Values(ResourceProvider::GLTexture,
587 ResourceProvider::Bitmap)); 586 ResourceProvider::Bitmap));
588 587
589 } // namespace 588 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698