OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 base::FilePath GetMediaTestDir() { | 59 base::FilePath GetMediaTestDir() { |
60 base::FilePath test_file; | 60 base::FilePath test_file; |
61 if (!PathService::Get(base::DIR_SOURCE_ROOT, &test_file)) | 61 if (!PathService::Get(base::DIR_SOURCE_ROOT, &test_file)) |
62 return base::FilePath(); | 62 return base::FilePath(); |
63 return test_file.AppendASCII("media").AppendASCII("test").AppendASCII("data"); | 63 return test_file.AppendASCII("media").AppendASCII("test").AppendASCII("data"); |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 namespace chrome { | |
69 | |
70 class MediaFileValidatorTest : public InProcessBrowserTest { | 68 class MediaFileValidatorTest : public InProcessBrowserTest { |
71 public: | 69 public: |
72 MediaFileValidatorTest() : test_file_size_(0) {} | 70 MediaFileValidatorTest() : test_file_size_(0) {} |
73 | 71 |
74 virtual ~MediaFileValidatorTest() {} | 72 virtual ~MediaFileValidatorTest() {} |
75 | 73 |
76 // Write |content| into |filename| in a test file system and try to move | 74 // Write |content| into |filename| in a test file system and try to move |
77 // it into a media file system. The result is compared to |expected_result|. | 75 // it into a media file system. The result is compared to |expected_result|. |
78 void MoveTest(const std::string& filename, const std::string& content, | 76 void MoveTest(const std::string& filename, const std::string& content, |
79 bool expected_result) { | 77 bool expected_result) { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 test_file = test_file.AppendASCII("no_streams.webm"); | 270 test_file = test_file.AppendASCII("no_streams.webm"); |
273 MoveTestFromFile("no_streams.webm", test_file, false); | 271 MoveTestFromFile("no_streams.webm", test_file, false); |
274 } | 272 } |
275 | 273 |
276 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { | 274 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { |
277 base::FilePath test_file = GetMediaTestDir(); | 275 base::FilePath test_file = GetMediaTestDir(); |
278 ASSERT_FALSE(test_file.empty()); | 276 ASSERT_FALSE(test_file.empty()); |
279 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); | 277 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); |
280 MoveTestFromFile("multitrack.webm", test_file, true); | 278 MoveTestFromFile("multitrack.webm", test_file, true); |
281 } | 279 } |
282 | |
283 } // namespace chrome | |
OLD | NEW |