| 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/public/test/content_browser_test.h" | 6 #include "content/public/test/content_browser_test.h" |
| 7 | 7 |
| 8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
| 9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #elif defined(OS_WIN) | 10 #elif defined(OS_WIN) |
| 11 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 typedef ContentBrowserTest CompositorUtilTest; | 16 typedef ContentBrowserTest CompositorUtilTest; |
| 17 | 17 |
| 18 // Test that threaded compositing and FCM are in the expected mode on the bots | 18 // Test that compositing is in the expected mode on the bots for all platforms. |
| 19 // for all platforms. | |
| 20 IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) { | 19 IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) { |
| 21 enum CompositingMode { | 20 enum CompositingMode { |
| 22 DISABLED, | 21 DIRECT, |
| 23 ENABLED, | 22 DELEGATED, |
| 24 THREADED, // Implies FCM | 23 } expected_mode = DIRECT; |
| 25 DELEGATED, // Implies threaded | |
| 26 } expected_mode = DISABLED; | |
| 27 #if defined(USE_AURA) | 24 #if defined(USE_AURA) |
| 28 expected_mode = DELEGATED; | 25 expected_mode = DELEGATED; |
| 29 #elif defined(OS_ANDROID) | |
| 30 expected_mode = DELEGATED; | |
| 31 #elif defined(OS_MACOSX) | 26 #elif defined(OS_MACOSX) |
| 32 expected_mode = THREADED; | 27 expected_mode = DIRECT; |
| 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()) | |
| 38 return; | |
| 39 #elif defined(OS_WIN) | |
| 40 if (base::win::GetVersion() >= base::win::VERSION_VISTA) | |
| 41 expected_mode = THREADED; | |
| 42 #endif | 28 #endif |
| 43 | 29 |
| 44 EXPECT_EQ(expected_mode == THREADED || | 30 EXPECT_EQ(expected_mode == DELEGATED, IsDelegatedRendererEnabled()); |
| 45 expected_mode == DELEGATED, | |
| 46 IsThreadedCompositingEnabled()); | |
| 47 EXPECT_EQ(expected_mode == DELEGATED, | |
| 48 IsDelegatedRendererEnabled()); | |
| 49 } | 31 } |
| 50 | 32 |
| 51 } | 33 } |
| OLD | NEW |