OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/gfx/test/gfx_test_utils.h" | 5 #include "ui/gfx/test/gfx_test_utils.h" |
6 | 6 |
7 #if defined(VIEWS_COMPOSITOR) | 7 #if defined(VIEWS_COMPOSITOR) |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "ui/gfx/compositor/compositor.h" | 9 #include "ui/gfx/compositor/compositor.h" |
10 #include "ui/gfx/compositor/test_compositor.h" | 10 #include "ui/gfx/compositor/test/test_compositor.h" |
11 #endif | 11 #endif |
12 | 12 |
13 #if defined(VIEWS_COMPOSITOR) | 13 #if defined(VIEWS_COMPOSITOR) |
14 namespace switches { | 14 namespace switches { |
15 | 15 |
16 const char kDisableTestCompositor[] = "disable-test-compositor"; | 16 const char kDisableTestCompositor[] = "disable-test-compositor"; |
17 | 17 |
18 } | 18 } |
19 #endif | 19 #endif |
20 | 20 |
21 namespace ui { | 21 namespace ui { |
22 namespace gfx_test_utils { | 22 namespace gfx_test_utils { |
23 | 23 |
24 void SetupTestCompositor() { | 24 void SetupTestCompositor() { |
25 #if defined(VIEWS_COMPOSITOR) | 25 #if defined(VIEWS_COMPOSITOR) |
26 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 26 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
27 switches::kDisableTestCompositor)) { | 27 switches::kDisableTestCompositor)) { |
28 // Use a mock compositor that noops draws. | 28 // Use a mock compositor that noops draws. |
29 ui::Compositor::set_compositor_factory_for_testing( | 29 ui::Compositor::set_compositor_factory_for_testing( |
30 ui::TestCompositor::Create); | 30 ui::TestCompositor::Create); |
31 } | 31 } |
32 #endif | 32 #endif |
33 } | 33 } |
34 | 34 |
35 } // namespace gfx_test_utils | 35 } // namespace gfx_test_utils |
36 } // namespace ui | 36 } // namespace ui |
OLD | NEW |