OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "webkit/tools/test_shell/test_shell.h" | 9 #include "webkit/tools/test_shell/test_shell.h" |
10 #include "webkit/tools/test_shell/test_shell_test.h" | 10 #include "webkit/tools/test_shell/test_shell_test.h" |
11 | 11 |
12 class MediaLeakTest : public TestShellTest { | 12 class MediaLeakTest : public TestShellTest { |
13 }; | 13 }; |
14 | 14 |
15 // Ignore these until 64-bit ffmpeg libs are available. http://crbug.com/20467 | 15 // Ignore these until 64-bit ffmpeg libs are available. http://crbug.com/20467 |
16 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(ARCH_CPU_64_BITS) | 16 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(ARCH_CPU_64_BITS) |
17 | 17 |
18 // This test plays a Theora video file for 1 second. It tries to expose | 18 // This test plays a Theora video file for 1 second. It tries to expose |
19 // memory leaks during a normal playback. | 19 // memory leaks during a normal playback. |
20 TEST_F(MediaLeakTest, VideoBear) { | 20 TEST_F(MediaLeakTest, VideoBear) { |
21 FilePath media_file; | 21 FilePath media_file; |
22 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &media_file)); | 22 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &media_file)); |
23 media_file = media_file.Append(FILE_PATH_LITERAL("webkit")) | 23 media_file = media_file.Append(FILE_PATH_LITERAL("webkit")) |
24 .Append(FILE_PATH_LITERAL("data")) | 24 .Append(FILE_PATH_LITERAL("data")) |
25 .Append(FILE_PATH_LITERAL("media")) | 25 .Append(FILE_PATH_LITERAL("media")) |
26 .Append(FILE_PATH_LITERAL("bear.html")); | 26 .Append(FILE_PATH_LITERAL("bear.html")); |
27 test_shell_->LoadURL(media_file.ToWStringHack().c_str()); | 27 test_shell_->LoadFile(media_file); |
28 test_shell_->WaitTestFinished(); | 28 test_shell_->WaitTestFinished(); |
29 } | 29 } |
30 | 30 |
31 // This test loads a Theora video file and unloads it many times. It tries | 31 // This test loads a Theora video file and unloads it many times. It tries |
32 // to expose memory leaks in the glue layer with WebKit. | 32 // to expose memory leaks in the glue layer with WebKit. |
33 TEST_F(MediaLeakTest, DISABLED_ManyVideoBear) { | 33 TEST_F(MediaLeakTest, DISABLED_ManyVideoBear) { |
34 FilePath media_file; | 34 FilePath media_file; |
35 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &media_file)); | 35 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &media_file)); |
36 media_file = media_file.Append(FILE_PATH_LITERAL("webkit")) | 36 media_file = media_file.Append(FILE_PATH_LITERAL("webkit")) |
37 .Append(FILE_PATH_LITERAL("data")) | 37 .Append(FILE_PATH_LITERAL("data")) |
38 .Append(FILE_PATH_LITERAL("media")) | 38 .Append(FILE_PATH_LITERAL("media")) |
39 .Append(FILE_PATH_LITERAL("manybear.html")); | 39 .Append(FILE_PATH_LITERAL("manybear.html")); |
40 test_shell_->LoadURL(media_file.ToWStringHack().c_str()); | 40 test_shell_->LoadFile(media_file); |
41 test_shell_->WaitTestFinished(); | 41 test_shell_->WaitTestFinished(); |
42 } | 42 } |
43 | 43 |
44 #endif | 44 #endif |
OLD | NEW |