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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 base::Bind(&MediaFileValidatorTest::CheckFiles, | 147 base::Bind(&MediaFileValidatorTest::CheckFiles, |
148 base::Unretained(this), true, | 148 base::Unretained(this), true, |
149 base::Bind(&MediaFileValidatorTest::OnTestFilesReady, | 149 base::Bind(&MediaFileValidatorTest::OnTestFilesReady, |
150 base::Unretained(this), expected_result))); | 150 base::Unretained(this), expected_result))); |
151 } | 151 } |
152 | 152 |
153 void SetupFromFileOnFileThread(const std::string& filename, | 153 void SetupFromFileOnFileThread(const std::string& filename, |
154 const base::FilePath& source, | 154 const base::FilePath& source, |
155 bool expected_result) { | 155 bool expected_result) { |
156 std::string content; | 156 std::string content; |
157 ASSERT_TRUE(file_util::ReadFileToString(source, &content)); | 157 ASSERT_TRUE(base::ReadFileToString(source, &content)); |
158 SetupOnFileThread(filename, content, expected_result); | 158 SetupOnFileThread(filename, content, expected_result); |
159 } | 159 } |
160 | 160 |
161 // Check that exactly one of |move_src_| and |move_dest_| exists. | 161 // Check that exactly one of |move_src_| and |move_dest_| exists. |
162 // |src_expected| indicates which one should exist. When complete, | 162 // |src_expected| indicates which one should exist. When complete, |
163 // |callback| is called with success/failure. | 163 // |callback| is called with success/failure. |
164 void CheckFiles(bool src_expected, | 164 void CheckFiles(bool src_expected, |
165 const base::Callback<void(bool success)>& callback) { | 165 const base::Callback<void(bool success)>& callback) { |
166 CheckFile(move_src_, src_expected ? test_file_size_ : kNoFileSize, | 166 CheckFile(move_src_, src_expected ? test_file_size_ : kNoFileSize, |
167 base::Bind(&MediaFileValidatorTest::OnCheckFilesFirstResult, | 167 base::Bind(&MediaFileValidatorTest::OnCheckFilesFirstResult, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } | 274 } |
275 | 275 |
276 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { | 276 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { |
277 base::FilePath test_file = GetMediaTestDir(); | 277 base::FilePath test_file = GetMediaTestDir(); |
278 ASSERT_FALSE(test_file.empty()); | 278 ASSERT_FALSE(test_file.empty()); |
279 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); | 279 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); |
280 MoveTestFromFile("multitrack.webm", test_file, true); | 280 MoveTestFromFile("multitrack.webm", test_file, true); |
281 } | 281 } |
282 | 282 |
283 } // namespace chrome | 283 } // namespace chrome |
OLD | NEW |