summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-10 20:34:25 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-10 20:34:25 +0000
commite4c745ceb30536be3700bd065ac9d405a0513cad (patch)
tree0ddad4b1f6015cd4f61d11343affbfc3bb88a4bb /webkit/tools/test_shell
parent9086a21f49a7f83a6ebab71e21aee316422dac9c (diff)
downloadchromium_src-e4c745ceb30536be3700bd065ac9d405a0513cad.zip
chromium_src-e4c745ceb30536be3700bd065ac9d405a0513cad.tar.gz
chromium_src-e4c745ceb30536be3700bd065ac9d405a0513cad.tar.bz2
Added a media playback test to test_shell_tests
Added MediaLeakTest.BearH264 in test_shell_tests to play a media file in test_shell. This is to facilitate running purify to detect memory leaks in the media player and <video>. Review URL: http://codereview.chromium.org/155237 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20407 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r--webkit/tools/test_shell/media_leak_test.cc31
-rw-r--r--webkit/tools/test_shell/test_shell.gyp1
2 files changed, 32 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/media_leak_test.cc b/webkit/tools/test_shell/media_leak_test.cc
new file mode 100644
index 0000000..c768a74
--- /dev/null
+++ b/webkit/tools/test_shell/media_leak_test.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2009 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 "base/file_path.h"
+#include "base/file_util.h"
+#include "base/path_service.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/tools/test_shell/test_shell.h"
+#include "webkit/tools/test_shell/test_shell_test.h"
+
+class MediaLeakTest : public TestShellTest {
+};
+
+// <video> and <audio> tags only work stably on Windows.
+#if defined(OS_WIN)
+
+// This test is to be executed in test_shell_tests so we can capture memory
+// leak analysis in automated runs.
+TEST_F(MediaLeakTest, VideoBear) {
+ FilePath media_file;
+ ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &media_file));
+ media_file = media_file.Append(FILE_PATH_LITERAL("webkit"))
+ .Append(FILE_PATH_LITERAL("data"))
+ .Append(FILE_PATH_LITERAL("media"))
+ .Append(FILE_PATH_LITERAL("bear.html"));
+ test_shell_->LoadURL(media_file.ToWStringHack().c_str());
+ test_shell_->WaitTestFinished();
+}
+
+#endif
diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp
index eb146d9..8313eff 100644
--- a/webkit/tools/test_shell/test_shell.gyp
+++ b/webkit/tools/test_shell/test_shell.gyp
@@ -487,6 +487,7 @@
'image_decoder_unittest.h',
'keyboard_unittest.cc',
'layout_test_controller_unittest.cc',
+ 'media_leak_test.cc',
'node_leak_test.cc',
'plugin_tests.cc',
'run_all_tests.cc',