1 // Copyright 2013 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.
5 #include "content/browser/gpu/compositor_util.h"
6 #include "content/test/content_browser_test.h"
9 #include "base/mac/mac_util.h"
11 #include "base/win/windows_version.h"
16 typedef ContentBrowserTest CompositorUtilTest
;
18 // Test that threaded compositing and FCM are in the expected mode on the bots
20 IN_PROC_BROWSER_TEST_F(CompositorUtilTest
, CompositingModeAsExpected
) {
21 enum CompositingMode
{
24 THREADED
, // Implies FCM
25 DELEGATED
, // Implies threaded
26 } expected_mode
= DISABLED
;
28 expected_mode
= DELEGATED
;
29 #elif defined(OS_ANDROID)
30 expected_mode
= THREADED
;
31 #elif defined(OS_MACOSX)
32 expected_mode
= THREADED
;
33 // Lion and SnowLeopard have compositing blacklisted when using the Apple
34 // software renderer, so results will vary depending if this test is being
35 // run in a VM versus actual hardware.
36 // http://crbug.com/230931
37 if (base::mac::IsOSLionOrEarlier())
40 if (base::win::GetVersion() >= base::win::VERSION_VISTA
)
41 expected_mode
= THREADED
;
44 EXPECT_EQ(expected_mode
== ENABLED
||
45 expected_mode
== THREADED
||
46 expected_mode
== DELEGATED
,
47 IsForceCompositingModeEnabled());
48 EXPECT_EQ(expected_mode
== THREADED
||
49 expected_mode
== DELEGATED
,
50 IsThreadedCompositingEnabled());
51 EXPECT_EQ(expected_mode
== DELEGATED
,
52 IsDelegatedRendererEnabled());