summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/gpu_uitest.cc10
-rw-r--r--chrome/browser/media_uitest.cc14
-rw-r--r--chrome/test/gpu/webgl_conformance_tests.cc7
-rw-r--r--chrome/test/perf/frame_rate/frame_rate_tests.cc15
-rw-r--r--chrome/test/ui/ui_test.cc34
-rw-r--r--chrome/test/ui/ui_test.h6
6 files changed, 47 insertions, 39 deletions
diff --git a/chrome/browser/gpu_uitest.cc b/chrome/browser/gpu_uitest.cc
index d4c2c3bc..7cc0019 100644
--- a/chrome/browser/gpu_uitest.cc
+++ b/chrome/browser/gpu_uitest.cc
@@ -17,16 +17,6 @@ class GPUUITest : public UITest {
}
virtual void SetUp() {
- EXPECT_TRUE(test_launcher_utils::OverrideGLImplementation(
- &launch_arguments_,
- gfx::kGLImplementationOSMesaName));
-
-#if defined(OS_MACOSX)
- // Accelerated compositing does not work with OSMesa. AcceleratedSurface
- // assumes GL contexts are native.
- launch_arguments_.AppendSwitch(switches::kDisableAcceleratedCompositing);
-#endif
-
UITest::SetUp();
gpu_test_dir_ = test_data_directory_.AppendASCII("gpu");
diff --git a/chrome/browser/media_uitest.cc b/chrome/browser/media_uitest.cc
index d25f5df..5a50934 100644
--- a/chrome/browser/media_uitest.cc
+++ b/chrome/browser/media_uitest.cc
@@ -17,20 +17,6 @@
class MediaTest : public UITest {
protected:
- virtual void SetUp() {
- EXPECT_TRUE(test_launcher_utils::OverrideGLImplementation(
- &launch_arguments_,
- gfx::kGLImplementationOSMesaName));
-
-#if defined(OS_MACOSX)
- // Accelerated compositing does not work with OSMesa. AcceleratedSurface
- // assumes GL contexts are native.
- launch_arguments_.AppendSwitch(switches::kDisableAcceleratedCompositing);
-#endif
-
- UITest::SetUp();
- }
-
void PlayMedia(const char* tag, const char* media_file) {
FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("media/player.html");
diff --git a/chrome/test/gpu/webgl_conformance_tests.cc b/chrome/test/gpu/webgl_conformance_tests.cc
index 103a841..2f4091c 100644
--- a/chrome/test/gpu/webgl_conformance_tests.cc
+++ b/chrome/test/gpu/webgl_conformance_tests.cc
@@ -32,10 +32,9 @@ class WebGLConformanceTests : public UITest {
void SetUp() {
// Force the use of GPU hardware.
- EXPECT_TRUE(test_launcher_utils::OverrideGLImplementation(
- &launch_arguments_,
- kGLImplementationName));
- // Assert that a GPU bot is never blacklisted.
+ force_use_osmesa_ = false;
+
+ // Ensure that a GPU bot is never blacklisted.
launch_arguments_.AppendSwitch(switches::kIgnoreGpuBlacklist);
UITest::SetUp();
}
diff --git a/chrome/test/perf/frame_rate/frame_rate_tests.cc b/chrome/test/perf/frame_rate/frame_rate_tests.cc
index a9a1991..15d3063 100644
--- a/chrome/test/perf/frame_rate/frame_rate_tests.cc
+++ b/chrome/test/perf/frame_rate/frame_rate_tests.cc
@@ -10,6 +10,7 @@
#include "base/test/test_timeouts.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/javascript_test_util.h"
#include "chrome/test/ui/ui_perf_test.h"
@@ -22,6 +23,10 @@ class FrameRateTest : public UIPerfTest {
FrameRateTest() {
show_window_ = true;
dom_automation_enabled_ = true;
+ // Since this is a performance test, try to use the host machine's GPU
+ // instead of falling back to software-rendering.
+ force_use_osmesa_ = false;
+ disable_accelerated_compositing_ = false;
}
virtual FilePath GetDataPath(const std::string& name) {
@@ -35,6 +40,16 @@ class FrameRateTest : public UIPerfTest {
return test_path;
}
+ virtual void SetUp() {
+ // UI tests boot up render views starting from about:blank. This causes the
+ // renderer to start up thinking it cannot use the GPU. To work around that,
+ // and allow the frame rate test to use the GPU, we must pass
+ // kAllowWebUICompositing.
+ launch_arguments_.AppendSwitch(switches::kAllowWebUICompositing);
+
+ UIPerfTest::SetUp();
+ }
+
void RunTest(const std::string& name, const std::string& suffix) {
FilePath test_path = GetDataPath(name);
ASSERT_TRUE(file_util::DirectoryExists(test_path))
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 81f03eb..bc89d33 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -89,7 +89,9 @@ UITestBase::UITestBase()
clear_profile_(true),
include_testing_id_(true),
enable_file_cookies_(true),
- profile_type_(UITestBase::DEFAULT_THEME) {
+ profile_type_(UITestBase::DEFAULT_THEME),
+ force_use_osmesa_(true),
+ disable_accelerated_compositing_(true) {
PathService::Get(chrome::DIR_APP, &browser_directory_);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
}
@@ -104,7 +106,9 @@ UITestBase::UITestBase(MessageLoop::Type msg_loop_type)
clear_profile_(true),
include_testing_id_(true),
enable_file_cookies_(true),
- profile_type_(UITestBase::DEFAULT_THEME) {
+ profile_type_(UITestBase::DEFAULT_THEME),
+ force_use_osmesa_(true),
+ disable_accelerated_compositing_(true) {
PathService::Get(chrome::DIR_APP, &browser_directory_);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
}
@@ -514,18 +518,26 @@ void UITest::SetUp() {
test_info->name());
}
- // Force tests to use OSMesa if they launch the GPU process. This is in
- // UITest::SetUp so that it does not affect pyautolib, which runs tests that
- // do not work with OSMesa.
- // Note, if the launch arguments already declared a GL implementation, do not
- // force OSMesa.
- if (!launch_arguments_.HasSwitch(switches::kUseGL))
+ // UI tests force the use of OSMesa by default because of various bad
+ // interactions between the GPU infrastructure, how our bots are configured,
+ // and existing performance expectations. The goal to slowly remove these
+ // special cases, as covered by:
+ // http://code.google.com/p/chromium/issues/detail?id=95782
+ //
+ // Note also that this disabling is done in UITest to avoid affecting
+ // pyautolib, which runs tests that do not work with OSMesa.
+ if (force_use_osmesa_) {
launch_arguments_.AppendSwitchASCII(switches::kUseGL,
gfx::kGLImplementationOSMesaName);
+ }
- // Mac does not support accelerated compositing with OSMesa. Disable on all
- // platforms so it is consistent. http://crbug.com/58343
- launch_arguments_.AppendSwitch(switches::kDisableAcceleratedCompositing);
+ // Disable acclerated compositing for tests unless they directly opt-in. The
+ // rationale for this is identical to the use of OSMesa: bad interactions
+ // between tests and the accelerated compositing system. The goal is to slowly
+ // remove this flag, as covered by:
+ // http://code.google.com/p/chromium/issues/detail?id=95782
+ if (disable_accelerated_compositing_)
+ launch_arguments_.AppendSwitch(switches::kDisableAcceleratedCompositing);
UITestBase::SetUp();
PlatformTest::SetUp();
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index a0f4ec6..6e4a4a2 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -356,6 +356,12 @@ class UITestBase {
// PID file for websocket server.
FilePath websocket_pid_file_;
+ // Whether to force use of mesa for GL rendering.
+ bool force_use_osmesa_;
+
+ // Whether to disable accelerated compositing for this test.
+ bool disable_accelerated_compositing_;
+
private:
// Time the test was started (so we can check for new crash dumps)
base::Time test_start_time_;