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