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

Side by Side Diff: cc/test/layer_tree_test_common.cc

Issue 11361223: cc: Remove cc::settings, move them to LayerTreeSettings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix-unittests 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 | Annotate | Revision Log
« no previous file with comments | « cc/software_renderer_unittest.cc ('k') | cc/test/test_common.h » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/test/layer_tree_test_common.h" 5 #include "cc/test/layer_tree_test_common.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "cc/active_animation.h" 8 #include "cc/active_animation.h"
9 #include "cc/content_layer.h" 9 #include "cc/content_layer.h"
10 #include "cc/input_handler.h" 10 #include "cc/input_handler.h"
11 #include "cc/layer.h" 11 #include "cc/layer.h"
12 #include "cc/layer_animation_controller.h" 12 #include "cc/layer_animation_controller.h"
13 #include "cc/layer_impl.h" 13 #include "cc/layer_impl.h"
14 #include "cc/layer_tree_host_impl.h" 14 #include "cc/layer_tree_host_impl.h"
15 #include "cc/scoped_thread_proxy.h" 15 #include "cc/scoped_thread_proxy.h"
16 #include "cc/settings.h"
17 #include "cc/single_thread_proxy.h" 16 #include "cc/single_thread_proxy.h"
18 #include "cc/thread_impl.h" 17 #include "cc/thread_impl.h"
19 #include "cc/test/animation_test_common.h" 18 #include "cc/test/animation_test_common.h"
20 #include "cc/test/fake_web_compositor_output_surface.h" 19 #include "cc/test/fake_web_compositor_output_surface.h"
21 #include "cc/test/fake_web_graphics_context_3d.h" 20 #include "cc/test/fake_web_graphics_context_3d.h"
22 #include "cc/test/occlusion_tracker_test_common.h" 21 #include "cc/test/occlusion_tracker_test_common.h"
23 #include "cc/test/test_common.h"
24 #include "cc/test/tiled_layer_test_common.h" 22 #include "cc/test/tiled_layer_test_common.h"
25 #include "cc/timing_function.h" 23 #include "cc/timing_function.h"
26 #include "testing/gmock/include/gmock/gmock.h" 24 #include "testing/gmock/include/gmock/gmock.h"
27 #include <public/WebFilterOperation.h> 25 #include <public/WebFilterOperation.h>
28 #include <public/WebFilterOperations.h> 26 #include <public/WebFilterOperations.h>
29 27
30 using cc::InputHandler; 28 using cc::InputHandler;
31 using cc::Layer; 29 using cc::Layer;
32 using cc::LayerTreeHostImplClient; 30 using cc::LayerTreeHostImplClient;
33 using cc::LayerTreeSettings; 31 using cc::LayerTreeSettings;
34 using cc::Proxy; 32 using cc::Proxy;
35 using cc::ScopedThreadProxy; 33 using cc::ScopedThreadProxy;
36 using cc::Settings;
37 34
38 using namespace WebKit; 35 using namespace WebKit;
39 36
40 namespace WebKitTests { 37 namespace WebKitTests {
41 38
42 scoped_ptr<CompositorFakeWebGraphicsContext3DWithTextureTracking> CompositorFake WebGraphicsContext3DWithTextureTracking::create(Attributes attrs) 39 scoped_ptr<CompositorFakeWebGraphicsContext3DWithTextureTracking> CompositorFake WebGraphicsContext3DWithTextureTracking::create(Attributes attrs)
43 { 40 {
44 return make_scoped_ptr(new CompositorFakeWebGraphicsContext3DWithTextureTrac king(attrs)); 41 return make_scoped_ptr(new CompositorFakeWebGraphicsContext3DWithTextureTrac king(attrs));
45 } 42 }
46 43
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 494
498 if (m_finished) 495 if (m_finished)
499 return; 496 return;
500 497
501 if (m_layerTreeHost.get()) 498 if (m_layerTreeHost.get())
502 m_layerTreeHost->didAddAnimation(); 499 m_layerTreeHost->didAddAnimation();
503 } 500 }
504 501
505 void ThreadedTest::runTest(bool threaded) 502 void ThreadedTest::runTest(bool threaded)
506 { 503 {
507 // For these tests, we will enable threaded animations.
508 ScopedSettings scopedSettings;
509 Settings::setAcceleratedAnimationEnabled(true);
510
511 if (threaded) { 504 if (threaded) {
512 m_implThread.reset(new base::Thread("ThreadedTest")); 505 m_implThread.reset(new base::Thread("ThreadedTest"));
513 ASSERT_TRUE(m_implThread->Start()); 506 ASSERT_TRUE(m_implThread->Start());
514 } 507 }
515 508
516 m_mainCCThread = cc::ThreadImpl::createForCurrentThread(); 509 m_mainCCThread = cc::ThreadImpl::createForCurrentThread();
517 m_mainThreadProxy = ScopedThreadProxy::create(m_mainCCThread.get()); 510 m_mainThreadProxy = ScopedThreadProxy::create(m_mainCCThread.get());
518 511
519 initializeSettings(m_settings); 512 initializeSettings(m_settings);
520 513
(...skipping 10 matching lines...) Expand all
531 ASSERT_FALSE(m_layerTreeHost.get()); 524 ASSERT_FALSE(m_layerTreeHost.get());
532 m_client.reset(); 525 m_client.reset();
533 if (m_timedOut) { 526 if (m_timedOut) {
534 FAIL() << "Test timed out"; 527 FAIL() << "Test timed out";
535 return; 528 return;
536 } 529 }
537 afterTest(); 530 afterTest();
538 } 531 }
539 532
540 } // namespace WebKitTests 533 } // namespace WebKitTests
OLDNEW
« no previous file with comments | « cc/software_renderer_unittest.cc ('k') | cc/test/test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698