diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-15 21:44:35 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-15 21:44:35 +0000 |
commit | e23a70d98ffcb0b9140b757ec01dbf7d1d3cf720 (patch) | |
tree | 17a8d2785ba7a2b5ac232488559f8becbdcdfaac /chrome | |
parent | 11fc764f26abbf31211618f538134b8bc98f4490 (diff) | |
download | chromium_src-e23a70d98ffcb0b9140b757ec01dbf7d1d3cf720.zip chromium_src-e23a70d98ffcb0b9140b757ec01dbf7d1d3cf720.tar.gz chromium_src-e23a70d98ffcb0b9140b757ec01dbf7d1d3cf720.tar.bz2 |
Removed --use-gl=osmesa as default for ui and browser tests.
Some tests require regular GL and appear not to be flaky.
This command line switch is now only passed to tests that are flaky on bots using regular GL.
TEST=run affected tests locally, try
BUG=55477, 62602
Review URL: http://codereview.chromium.org/4784001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/media_uitest.cc | 55 | ||||
-rw-r--r-- | chrome/test/gpu/gpu_browsertest.cc | 22 | ||||
-rw-r--r-- | chrome/test/gpu/gpu_uitest.cc | 18 | ||||
-rw-r--r-- | chrome/test/in_process_browser_test.cc | 10 | ||||
-rw-r--r-- | chrome/test/test_launcher_utils.cc | 12 | ||||
-rw-r--r-- | chrome/test/test_launcher_utils.h | 8 |
6 files changed, 78 insertions, 47 deletions
diff --git a/chrome/browser/media_uitest.cc b/chrome/browser/media_uitest.cc index c5c444b..fbbdebc 100644 --- a/chrome/browser/media_uitest.cc +++ b/chrome/browser/media_uitest.cc @@ -2,16 +2,33 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/gfx/gl/gl_implementation.h" #include "base/basictypes.h" #include "base/file_path.h" #include "base/platform_thread.h" #include "base/string_util.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/test/test_launcher_utils.h" #include "chrome/test/ui/ui_layout_test.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" 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"); @@ -48,28 +65,6 @@ class MediaTest : public UITest { } }; -#if defined(OS_WIN) - -// Tests always fail on windows: http://crbug.com/55477 -#define MAYBE_VideoBearTheora DISABLED_VideoBearTheora -#define MAYBE_VideoBearSilentTheora DISABLED_VideoBearSilentTheora -#define MAYBE_VideoBearWebm DISABLED_VideoBearWebm -#define MAYBE_VideoBearSilentWebm DISABLED_VideoBearSilentWebm -#define MAYBE_VideoBearMp4 DISABLED_VideoBearMp4 -#define MAYBE_VideoBearSilentMp4 DISABLED_VideoBearSilentMp4 -#define MAYBE_VideoBearWav DISABLED_VideoBearWav -#define MAYBE_MediaUILayoutTest DISABLED_MediaUILayoutTest - -#else - -#define MAYBE_VideoBearTheora VideoBearTheora -#define MAYBE_VideoBearSilentTheora VideoBearSilentTheora -#define MAYBE_VideoBearWebm VideoBearWebm -#define MAYBE_VideoBearSilentWebm VideoBearSilentWebm -#define MAYBE_VideoBearMp4 VideoBearMp4 -#define MAYBE_VideoBearSilentMp4 VideoBearSilentMp4 -#define MAYBE_VideoBearWav VideoBearWav - #if defined(OS_LINUX) // Test fails on linux: http://crbug.com/56364 #define MAYBE_MediaUILayoutTest DISABLED_MediaUILayoutTest @@ -77,35 +72,33 @@ class MediaTest : public UITest { #define MAYBE_MediaUILayoutTest MediaUILayoutTest #endif -#endif - -TEST_F(MediaTest, MAYBE_VideoBearTheora) { +TEST_F(MediaTest, VideoBearTheora) { PlayVideo("bear.ogv"); } -TEST_F(MediaTest, MAYBE_VideoBearSilentTheora) { +TEST_F(MediaTest, VideoBearSilentTheora) { PlayVideo("bear_silent.ogv"); } -TEST_F(MediaTest, MAYBE_VideoBearWebm) { +TEST_F(MediaTest, VideoBearWebm) { PlayVideo("bear.webm"); } -TEST_F(MediaTest, MAYBE_VideoBearSilentWebm) { +TEST_F(MediaTest, VideoBearSilentWebm) { PlayVideo("bear_silent.webm"); } #if defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) -TEST_F(MediaTest, MAYBE_VideoBearMp4) { +TEST_F(MediaTest, VideoBearMp4) { PlayVideo("bear.mp4"); } -TEST_F(MediaTest, MAYBE_VideoBearSilentMp4) { +TEST_F(MediaTest, VideoBearSilentMp4) { PlayVideo("bear_silent.mp4"); } #endif -TEST_F(MediaTest, MAYBE_VideoBearWav) { +TEST_F(MediaTest, VideoBearWav) { PlayVideo("bear.wav"); } diff --git a/chrome/test/gpu/gpu_browsertest.cc b/chrome/test/gpu/gpu_browsertest.cc index ea8eb9b..2a549d1 100644 --- a/chrome/test/gpu/gpu_browsertest.cc +++ b/chrome/test/gpu/gpu_browsertest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/gfx/gl/gl_implementation.h" +#include "base/command_line.h" #include "base/path_service.h" #include "base/string16.h" #include "base/utf_string_conversions.h" @@ -9,7 +11,9 @@ #include "chrome/browser/browser.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/chrome_switches.h" #include "chrome/test/in_process_browser_test.h" +#include "chrome/test/test_launcher_utils.h" #include "chrome/test/ui_test_utils.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" @@ -25,13 +29,25 @@ class GPUBrowserTest : public InProcessBrowserTest { gpu_test_dir_ = test_dir.AppendASCII("gpu"); } + virtual void SetUpCommandLine(CommandLine* command_line) { + InProcessBrowserTest::SetUpCommandLine(command_line); + + EXPECT_TRUE(test_launcher_utils::OverrideGLImplementation( + command_line, + gfx::kGLImplementationOSMesaName)); + +#if defined(OS_MACOSX) + // Accelerated compositing does not work with OSMesa. AcceleratedSurface + // assumes GL contexts are native. + command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); +#endif + } + FilePath gpu_test_dir_; }; -IN_PROC_BROWSER_TEST_F(GPUBrowserTest, BrowserTestLaunchedWithOSMesa) { +IN_PROC_BROWSER_TEST_F(GPUBrowserTest, BrowserTestCanLaunchWithOSMesa) { // Check the webgl test reports success and that the renderer was OSMesa. - // We use OSMesa for tests in order to get consistent results across a - // variety of boxes. ui_test_utils::NavigateToURL( browser(), net::FilePathToFileURL(gpu_test_dir_.AppendASCII("webgl.html"))); diff --git a/chrome/test/gpu/gpu_uitest.cc b/chrome/test/gpu/gpu_uitest.cc index c22f8f8..e5792a3 100644 --- a/chrome/test/gpu/gpu_uitest.cc +++ b/chrome/test/gpu/gpu_uitest.cc @@ -4,7 +4,10 @@ #include <string> +#include "app/gfx/gl/gl_implementation.h" #include "build/build_config.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/test/test_launcher_utils.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" @@ -14,17 +17,26 @@ 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"); } FilePath gpu_test_dir_; }; -TEST_F(GPUUITest, UITestLaunchedWithOSMesa) { +TEST_F(GPUUITest, UITestCanLaunchWithOSMesa) { // Check the webgl test reports success and that the renderer was OSMesa. - // We use OSMesa for tests in order to get consistent results across a - // variety of boxes. NavigateToURL( net::FilePathToFileURL(gpu_test_dir_.AppendASCII("webgl.html"))); diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index 78781fc..c690cd2 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -4,8 +4,6 @@ #include "chrome/test/in_process_browser_test.h" -#include "app/app_switches.h" -#include "app/gfx/gl/gl_implementation.h" #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" @@ -154,14 +152,6 @@ void InProcessBrowserTest::SetUp() { // This is a Browser test. command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType); - // Force tests to use OSMesa if they launch the GPU process. - command_line->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 - command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); - // Single-process mode is not set in BrowserMain so it needs to be processed // explicitly. original_single_process_ = RenderProcessHost::run_renderer_in_process(); diff --git a/chrome/test/test_launcher_utils.cc b/chrome/test/test_launcher_utils.cc index 413fe86..df60f30 100644 --- a/chrome/test/test_launcher_utils.cc +++ b/chrome/test/test_launcher_utils.cc @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "app/app_switches.h" #include "base/command_line.h" #include "base/environment.h" +#include "base/logging.h" #include "base/path_service.h" #include "base/scoped_ptr.h" #include "chrome/common/chrome_paths.h" @@ -56,4 +58,14 @@ bool OverrideUserDataDir(const FilePath& user_data_dir) { return success; } +bool OverrideGLImplementation(CommandLine* command_line, + std::string& implementation_name) { + if (command_line->HasSwitch(switches::kUseGL)) + return false; + + command_line->AppendSwitchASCII(switches::kUseGL, implementation_name); + + return true; +} + } // namespace test_launcher_utils diff --git a/chrome/test/test_launcher_utils.h b/chrome/test/test_launcher_utils.h index b4c1ac0..f81edc6 100644 --- a/chrome/test/test_launcher_utils.h +++ b/chrome/test/test_launcher_utils.h @@ -6,6 +6,8 @@ #define CHROME_TEST_TEST_LAUNCHER_UTILS_H_ #pragma once +#include <string> + #include "base/compiler_specific.h" #include "base/file_path.h" @@ -21,6 +23,12 @@ void PrepareBrowserCommandLineForTests(CommandLine* command_line); // Overrides the current process' user data dir. bool OverrideUserDataDir(const FilePath& user_data_dir) WARN_UNUSED_RESULT; +// Override the GL implementation. The names are the same as for the --use-gl +// command line switch. Use the constants in the gfx namespace. +bool OverrideGLImplementation( + CommandLine* command_line, + const std::string& implementation_name) WARN_UNUSED_RESULT; + } // namespace test_launcher_utils #endif // CHROME_TEST_TEST_LAUNCHER_UTILS_H_ |