summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/compositor_util_browsertest.cc
blob: ac39daceed31e761d552b19c7fecef5448f41cae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/gpu/compositor_util.h"
#include "content/test/content_browser_test.h"

#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#elif defined(OS_WIN)
#include "base/win/windows_version.h"
#endif

namespace content {

typedef ContentBrowserTest CompositorUtilTest;

// Test that threaded compositing and FCM are in the expected mode on the bots
// for all platforms.
IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) {
  enum CompositingMode {
    DISABLED,
    ENABLED,
    THREADED,  // Implies FCM
    DELEGATED,  // Implies threaded
  } expected_mode = DISABLED;
#if defined(USE_AURA)
  expected_mode = DELEGATED;
#elif defined(OS_ANDROID)
  expected_mode = THREADED;
#elif defined(OS_MACOSX)
  expected_mode = THREADED;
  // Lion and SnowLeopard have compositing blacklisted when using the Apple
  // software renderer, so results will vary depending if this test is being
  // run in a VM versus actual hardware.
  // http://crbug.com/230931
  if (base::mac::IsOSLionOrEarlier())
    return;
#elif defined(OS_WIN)
  if (base::win::GetVersion() >= base::win::VERSION_VISTA)
    expected_mode = THREADED;
#endif

  EXPECT_EQ(expected_mode == ENABLED ||
            expected_mode == THREADED ||
            expected_mode == DELEGATED,
            IsForceCompositingModeEnabled());
  EXPECT_EQ(expected_mode == THREADED ||
            expected_mode == DELEGATED,
            IsThreadedCompositingEnabled());
  EXPECT_EQ(expected_mode == DELEGATED,
            IsDelegatedRendererEnabled());
}

}