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

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: Address code review comments and fix all cc_unittests 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
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 "CCGraphicsContext.h" 9 #include "CCGraphicsContext.h"
10 #include "base/logging.h" 10 #include "base/logging.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
14 #include "cc/test/compositor_fake_web_graphics_context_3d.h" 13 #include "cc/test/compositor_fake_web_graphics_context_3d.h"
15 #include "cc/test/fake_web_compositor_output_surface.h" 14 #include "cc/test/fake_web_compositor_output_surface.h"
16 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
17 #include "third_party/khronos/GLES2/gl2.h" 16 #include "third_party/khronos/GLES2/gl2.h"
18 #include "third_party/khronos/GLES2/gl2ext.h" 17 #include "third_party/khronos/GLES2/gl2ext.h"
19 #include <public/WebGraphicsContext3D.h> 18 #include <public/WebGraphicsContext3D.h>
20 19
21 using namespace cc; 20 using namespace cc;
22 using namespace WebKit; 21 using namespace WebKit;
23 22
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 292 }
294 293
295 void expectNumResources(int count) 294 void expectNumResources(int count)
296 { 295 {
297 EXPECT_EQ(count, static_cast<int>(m_resourceProvider->numResources())); 296 EXPECT_EQ(count, static_cast<int>(m_resourceProvider->numResources()));
298 if (GetParam() == ResourceProvider::GLTexture) 297 if (GetParam() == ResourceProvider::GLTexture)
299 EXPECT_EQ(count, context()->textureCount()); 298 EXPECT_EQ(count, context()->textureCount());
300 } 299 }
301 300
302 protected: 301 protected:
303 DebugScopedSetImplThread implThread;
304 scoped_ptr<ContextSharedData> m_sharedData; 302 scoped_ptr<ContextSharedData> m_sharedData;
305 scoped_ptr<GraphicsContext> m_context; 303 scoped_ptr<GraphicsContext> m_context;
306 scoped_ptr<ResourceProvider> m_resourceProvider; 304 scoped_ptr<ResourceProvider> m_resourceProvider;
307 }; 305 };
308 306
309 TEST_P(ResourceProviderTest, Basic) 307 TEST_P(ResourceProviderTest, Basic)
310 { 308 {
311 IntSize size(1, 1); 309 IntSize size(1, 1);
312 WGC3Denum format = GL_RGBA; 310 WGC3Denum format = GL_RGBA;
313 int pool = 1; 311 int pool = 1;
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 } 578 }
581 EXPECT_EQ(0u, childResourceProvider->numResources()); 579 EXPECT_EQ(0u, childResourceProvider->numResources());
582 } 580 }
583 581
584 INSTANTIATE_TEST_CASE_P(ResourceProviderTests, 582 INSTANTIATE_TEST_CASE_P(ResourceProviderTests,
585 ResourceProviderTest, 583 ResourceProviderTest,
586 ::testing::Values(ResourceProvider::GLTexture, 584 ::testing::Values(ResourceProvider::GLTexture,
587 ResourceProvider::Bitmap)); 585 ResourceProvider::Bitmap));
588 586
589 } // namespace 587 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698