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

Side by Side Diff: ui/compositor/test/test_suite.cc

Issue 145293007: ui: No more TestCompositor. Use NullDraw contexts in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testsnulldraw: Created 6 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/test/test_suite.h" 5 #include "ui/compositor/test/test_suite.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "ui/compositor/compositor.h" 9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_switches.h" 10 #include "ui/compositor/compositor_switches.h"
11 #include "ui/gfx/gfx_paths.h" 11 #include "ui/gfx/gfx_paths.h"
12 #include "ui/gl/gl_surface.h" 12 #include "ui/gl/gl_surface.h"
13 13
14 #if defined(USE_X11)
15 #include <X11/Xlib.h>
16 #endif
17
18 #if defined(OS_WIN) 14 #if defined(OS_WIN)
19 #include "ui/gfx/win/dpi.h" 15 #include "ui/gfx/win/dpi.h"
20 #endif 16 #endif
21 17
22 namespace ui { 18 namespace ui {
23 namespace test { 19 namespace test {
24 20
25 CompositorTestSuite::CompositorTestSuite(int argc, char** argv) 21 CompositorTestSuite::CompositorTestSuite(int argc, char** argv)
26 : TestSuite(argc, argv) {} 22 : TestSuite(argc, argv) {}
27 23
28 CompositorTestSuite::~CompositorTestSuite() {} 24 CompositorTestSuite::~CompositorTestSuite() {}
29 25
30 void CompositorTestSuite::Initialize() { 26 void CompositorTestSuite::Initialize() {
31 #if defined(USE_X11)
32 XInitThreads();
33 #endif
34 base::TestSuite::Initialize(); 27 base::TestSuite::Initialize();
35 gfx::GLSurface::InitializeOneOffForTests(); 28 gfx::GLSurface::InitializeOneOffForTests();
36 29
37 gfx::RegisterPathProvider(); 30 gfx::RegisterPathProvider();
38 31
39 #if defined(OS_WIN) 32 #if defined(OS_WIN)
40 gfx::InitDeviceScaleFactor(1.0f); 33 gfx::InitDeviceScaleFactor(1.0f);
41 #endif 34 #endif
42 35
43 message_loop_.reset(new base::MessageLoopForUI); 36 message_loop_.reset(new base::MessageLoopForUI);
44 } 37 }
45 38
46 void CompositorTestSuite::Shutdown() { 39 void CompositorTestSuite::Shutdown() {
47 message_loop_.reset(); 40 message_loop_.reset();
48 41
49 base::TestSuite::Shutdown(); 42 base::TestSuite::Shutdown();
50 } 43 }
51 44
52 } // namespace test 45 } // namespace test
53 } // namespace ui 46 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698