diff options
author | hclam@google.com <hclam@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 20:49:21 +0000 |
---|---|---|
committer | hclam@google.com <hclam@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-22 20:49:21 +0000 |
commit | 842ffc55330e73a0a33ec9ea8facced86b348de5 (patch) | |
tree | 60f652f33a005891e665473fe9924ddd251bed85 /webkit/tools | |
parent | f055adaf0e0acfadd3d947b30ad32ffddf267f1a (diff) | |
download | chromium_src-842ffc55330e73a0a33ec9ea8facced86b348de5.zip chromium_src-842ffc55330e73a0a33ec9ea8facced86b348de5.tar.gz chromium_src-842ffc55330e73a0a33ec9ea8facced86b348de5.tar.bz2 |
Additional test to exploit memory leaks in <video>
TEST=MediaLeakTest.ManyVideoBear
This test inject and remove a <video> element many (50) times.
Trying to exploit memory leaks during the creation and
destruction of the internal media player and the glue code
with WebKit.
Review URL: http://codereview.chromium.org/159204
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21317 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/media_leak_test.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/webkit/tools/test_shell/media_leak_test.cc b/webkit/tools/test_shell/media_leak_test.cc index 2b58021..381c097 100644 --- a/webkit/tools/test_shell/media_leak_test.cc +++ b/webkit/tools/test_shell/media_leak_test.cc @@ -10,21 +10,31 @@ #include "webkit/tools/test_shell/test_shell_test.h" class MediaLeakTest : public TestShellTest { + public: + void RunTest(const char* file) { + 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(file)); + test_shell_->LoadURL(media_file.ToWStringHack().c_str()); + test_shell_->WaitTestFinished(); + } }; #if defined(OS_WIN) || defined(OS_LINUX) -// This test is to be executed in test_shell_tests so we can capture memory -// leak analysis in automated runs. +// This test plays a Theora video file for 1 second. It tries to expose +// memory leaks during a normal playback. 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(); + RunTest("bear.html"); +} + +// This test loads a Theora video file and unloads it many times. It tries +// to expose memory leaks in the glue layer with WebKit. +TEST_F(MediaLeakTest, ManyVideoBear) { + RunTest("manybear.html"); } #endif |