OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 "content/browser/gpu/compositor_util.h" | 5 #include "content/browser/gpu/compositor_util.h" |
6 #include "content/test/content_browser_test.h" | 6 #include "content/test/content_browser_test.h" |
7 | 7 |
8 #if defined(OS_WIN) | 8 #if defined(OS_MACOSX) |
| 9 #include "base/mac/mac_util.h" |
| 10 #elif defined(OS_WIN) |
9 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" |
10 #endif | 12 #endif |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 | 15 |
14 typedef ContentBrowserTest CompositorUtilTest; | 16 typedef ContentBrowserTest CompositorUtilTest; |
15 | 17 |
16 // Test that threaded compositing and FCM are in the expected mode on the bots | 18 // Test that threaded compositing and FCM are in the expected mode on the bots |
17 // for all platforms. | 19 // for all platforms. |
18 IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) { | 20 IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) { |
19 enum CompositingMode { | 21 enum CompositingMode { |
20 DISABLED, | 22 DISABLED, |
21 ENABLED, | 23 ENABLED, |
22 THREADED, | 24 THREADED, |
23 } expected_mode = DISABLED; | 25 } expected_mode = DISABLED; |
24 #if defined(OS_ANDROID) || defined(USE_AURA) | 26 #if defined(OS_ANDROID) || defined(USE_AURA) |
25 expected_mode = THREADED; | 27 expected_mode = THREADED; |
| 28 #elif defined(OS_MACOSX) |
| 29 if (base::mac::IsOSMountainLionOrLater()) |
| 30 expected_mode = ENABLED; |
26 #elif defined(OS_WIN) | 31 #elif defined(OS_WIN) |
27 if (base::win::GetVersion() >= base::win::VERSION_VISTA) | 32 if (base::win::GetVersion() >= base::win::VERSION_VISTA) |
28 expected_mode = ENABLED; | 33 expected_mode = ENABLED; |
29 #endif | 34 #endif |
30 | 35 |
31 EXPECT_EQ(expected_mode == ENABLED || expected_mode == THREADED, | 36 EXPECT_EQ(expected_mode == ENABLED || expected_mode == THREADED, |
32 IsForceCompositingModeEnabled()); | 37 IsForceCompositingModeEnabled()); |
33 EXPECT_EQ(expected_mode == THREADED, IsThreadedCompositingEnabled()); | 38 EXPECT_EQ(expected_mode == THREADED, IsThreadedCompositingEnabled()); |
34 } | 39 } |
35 | 40 |
36 } | 41 } |
OLD | NEW |