Chromium Code Reviews| Index: content/browser/audio_browsertest.cc |
| =================================================================== |
| --- content/browser/audio_browsertest.cc (revision 129879) |
| +++ content/browser/audio_browsertest.cc (working copy) |
| @@ -2,63 +2,51 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "base/file_path.h" |
| -#include "chrome/test/ui/ui_layout_test.h" |
| +#include "content/test/layout_browsertest.h" |
| -namespace { |
| - const char* kResources[] = { |
| - "content", |
| - "media-file.js", |
| - "video-test.js", |
| - }; |
| -} // anonymous namespace |
| +class AudioLayoutTest : public InProcessBrowserLayoutTest { |
| + protected: |
| + AudioLayoutTest() : InProcessBrowserLayoutTest( |
| + FilePath(), FilePath().AppendASCII("media")) { |
| + } |
| + virtual ~AudioLayoutTest() {} |
| -class AudioUILayoutTest : public UILayoutTest { |
| - protected: |
| - virtual ~AudioUILayoutTest() { } |
| - |
| - void RunMediaLayoutTest(const std::string& test_case_file_name) { |
| - FilePath test_dir; |
| - FilePath media_test_dir; |
| - media_test_dir = media_test_dir.AppendASCII("media"); |
| - InitializeForLayoutTest(test_dir, media_test_dir, kNoHttpPort); |
| - |
| - // Copy resources first. |
| - for (size_t i = 0; i < arraysize(kResources); ++i) { |
| - AddResourceForLayoutTest( |
| - test_dir, media_test_dir.AppendASCII(kResources[i])); |
| - } |
| - |
| - printf("Test: %s\n", test_case_file_name.c_str()); |
| - RunLayoutTest(test_case_file_name, kNoHttpPort); |
| - } |
| + virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| + InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture(); |
| + AddResourceForLayoutTest(FilePath().AppendASCII("media"), |
| + FilePath().AppendASCII("content")); |
| + AddResourceForLayoutTest(FilePath().AppendASCII("media"), |
| + FilePath().AppendASCII("media-file.js")); |
| + AddResourceForLayoutTest(FilePath().AppendASCII("media"), |
| + FilePath().AppendASCII("video-test.js")); |
| + } |
| }; |
| - |
| -TEST_F(AudioUILayoutTest, AudioConstructorPreload) { |
| - RunMediaLayoutTest("audio-constructor-preload.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, AudioConstructorPreload) { |
| + RunLayoutTest("audio-constructor-preload.html"); |
| } |
| -TEST_F(AudioUILayoutTest, AudioConstructor) { |
| - RunMediaLayoutTest("audio-constructor.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, AudioConstructor) { |
| + RunLayoutTest("audio-constructor.html"); |
| } |
| -TEST_F(AudioUILayoutTest, AudioConstructorSrc) { |
| - RunMediaLayoutTest("audio-constructor-src.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, AudioConstructorSrc) { |
| + RunLayoutTest("audio-constructor-src.html"); |
| } |
| -TEST_F(AudioUILayoutTest, AudioDataUrl) { |
| - RunMediaLayoutTest("audio-data-url.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, AudioDataUrl) { |
| + RunLayoutTest("audio-data-url.html"); |
| } |
| // The test fails since there is no real audio device on the build bots to get |
| // the ended event fired. Should pass once we run it on bots with audio devices. |
| -TEST_F(AudioUILayoutTest, DISABLED_AudioGarbageCollect) { |
| - RunMediaLayoutTest("audio-garbage-collect.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, DISABLED_AudioGarbageCollect) { |
| + RunLayoutTest("audio-garbage-collect.html"); |
| } |
| -TEST_F(AudioUILayoutTest, AudioNoInstalledEngines) { |
| - RunMediaLayoutTest("audio-no-installed-engines.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, AudioNoInstalledEngines) { |
| + set_wait_until_done(false); // This test just ensures no crash. |
|
scherkus (not reviewing)
2012/03/30 19:53:08
what's up with this?
jam
2012/03/30 20:19:06
you know, i thought that the ui_test version was t
|
| + RunLayoutTest("audio-no-installed-engines.html"); |
| } |
| #if defined(OS_CHROMEOS) && defined(USE_AURA) |
| @@ -68,19 +56,18 @@ |
| #define MAYBE_AudioOnlyVideoIntrinsicSize AudioOnlyVideoIntrinsicSize |
| #endif |
| -TEST_F(AudioUILayoutTest, MAYBE_AudioOnlyVideoIntrinsicSize) { |
| - RunMediaLayoutTest("audio-only-video-intrinsic-size.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, MAYBE_AudioOnlyVideoIntrinsicSize) { |
| + RunLayoutTest("audio-only-video-intrinsic-size.html"); |
| } |
| -TEST_F(AudioUILayoutTest, AudioPlayEvent) { |
| - RunMediaLayoutTest("audio-play-event.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, AudioPlayEvent) { |
| + RunLayoutTest("audio-play-event.html"); |
| } |
| -TEST_F(AudioUILayoutTest, MediaCanPlayWavAudio) { |
| - RunMediaLayoutTest("media-can-play-wav-audio.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, MediaCanPlayWavAudio) { |
| + RunLayoutTest("media-can-play-wav-audio.html"); |
| } |
| -TEST_F(AudioUILayoutTest, MediaDocumentAudioSize) { |
| - RunMediaLayoutTest("media-document-audio-size.html"); |
| +IN_PROC_BROWSER_TEST_F(AudioLayoutTest, MediaDocumentAudioSize) { |
| + RunLayoutTest("media-document-audio-size.html"); |
| } |
| - |