Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: content/browser/audio_browsertest.cc

Issue 9959028: Convert the media and audio UI test to a browser_test. browser_tests are sharded and run quicker, a… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/media/player.html ('k') | content/browser/media_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/audio_browsertest.cc
===================================================================
--- content/browser/audio_browsertest.cc (revision 129879)
+++ content/browser/audio_browsertest.cc (working copy)
@@ -2,63 +2,50 @@
// 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) {
+ RunLayoutTest("audio-no-installed-engines.html");
}
#if defined(OS_CHROMEOS) && defined(USE_AURA)
@@ -68,19 +55,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");
}
-
« no previous file with comments | « chrome/test/data/media/player.html ('k') | content/browser/media_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698