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

Side by Side Diff: ui/gfx/test/gfx_test_utils.cc

Issue 8240006: Use a mocked compositor for unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ui/gfx/test/gfx_test_utils x4 Created 9 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 | Annotate | Revision Log
OLDNEW
(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 #include "base/command_line.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/gl/gl_switches.h"
10
11 #if defined(VIEWS_COMPOSITOR)
12 #include "ui/gfx/compositor/compositor.h"
13 #include "ui/gfx/compositor/test_compositor.h"
14 #endif
15
16 namespace ui {
17 namespace gfx_test_utils {
18
19 void SetupTestCompositor() {
20 #if defined(OS_LINUX)
21 // Test bots don't have DesktopGL/EGL.
22 EXPECT_TRUE(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL));
Paweł Hajdan Jr. 2011/10/19 08:49:37 Please convert it so that the function returns boo
danakj 2011/10/19 13:55:48 So if you have GL set to something already the tes
23 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
24 switches::kUseGL, gfx::kGLImplementationOSMesaName);
25 #endif
26
27 #if defined(VIEWS_COMPOSITOR)
28 // Use a mock compositor that noops draws.
29 ui::Compositor::set_compositor_factory_for_testing(
30 ui::TestCompositor::Create);
31 #endif
32 }
33
34 } // namespace gfx_test_utils
35 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698