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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <utility> |
7 | 8 |
8 #include "base/bind.h" | 9 #include "base/bind.h" |
9 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
11 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
12 #include "base/location.h" | 13 #include "base/location.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
15 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
16 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 base::FilePath src_path = base.AppendASCII("src_fs"); | 112 base::FilePath src_path = base.AppendASCII("src_fs"); |
112 ASSERT_TRUE(base::CreateDirectory(src_path)); | 113 ASSERT_TRUE(base::CreateDirectory(src_path)); |
113 | 114 |
114 ScopedVector<storage::FileSystemBackend> additional_providers; | 115 ScopedVector<storage::FileSystemBackend> additional_providers; |
115 additional_providers.push_back(new content::TestFileSystemBackend( | 116 additional_providers.push_back(new content::TestFileSystemBackend( |
116 base::ThreadTaskRunnerHandle::Get().get(), src_path)); | 117 base::ThreadTaskRunnerHandle::Get().get(), src_path)); |
117 additional_providers.push_back(new MediaFileSystemBackend( | 118 additional_providers.push_back(new MediaFileSystemBackend( |
118 base, base::ThreadTaskRunnerHandle::Get().get())); | 119 base, base::ThreadTaskRunnerHandle::Get().get())); |
119 file_system_context_ = | 120 file_system_context_ = |
120 content::CreateFileSystemContextWithAdditionalProvidersForTesting( | 121 content::CreateFileSystemContextWithAdditionalProvidersForTesting( |
121 NULL, additional_providers.Pass(), base); | 122 NULL, std::move(additional_providers), base); |
122 | 123 |
123 move_src_ = file_system_context_->CreateCrackedFileSystemURL( | 124 move_src_ = file_system_context_->CreateCrackedFileSystemURL( |
124 GURL(kOrigin), | 125 GURL(kOrigin), |
125 storage::kFileSystemTypeTest, | 126 storage::kFileSystemTypeTest, |
126 base::FilePath::FromUTF8Unsafe(filename)); | 127 base::FilePath::FromUTF8Unsafe(filename)); |
127 | 128 |
128 test_file_size_ = content.size(); | 129 test_file_size_ = content.size(); |
129 base::FilePath test_file = src_path.AppendASCII(filename); | 130 base::FilePath test_file = src_path.AppendASCII(filename); |
130 ASSERT_EQ(test_file_size_, | 131 ASSERT_EQ(test_file_size_, |
131 base::WriteFile(test_file, content.data(), test_file_size_)); | 132 base::WriteFile(test_file, content.data(), test_file_size_)); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 test_file = test_file.AppendASCII("no_streams.webm"); | 281 test_file = test_file.AppendASCII("no_streams.webm"); |
281 MoveTestFromFile("no_streams.webm", test_file, false); | 282 MoveTestFromFile("no_streams.webm", test_file, false); |
282 } | 283 } |
283 | 284 |
284 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { | 285 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { |
285 base::FilePath test_file = GetMediaTestDir(); | 286 base::FilePath test_file = GetMediaTestDir(); |
286 ASSERT_FALSE(test_file.empty()); | 287 ASSERT_FALSE(test_file.empty()); |
287 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); | 288 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); |
288 MoveTestFromFile("multitrack.webm", test_file, true); | 289 MoveTestFromFile("multitrack.webm", test_file, true); |
289 } | 290 } |
OLD | NEW |