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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 content::CreateFileSystemContextWithAdditionalProvidersForTesting( | 116 content::CreateFileSystemContextWithAdditionalProvidersForTesting( |
117 NULL, additional_providers.Pass(), base); | 117 NULL, additional_providers.Pass(), base); |
118 | 118 |
119 move_src_ = file_system_context_->CreateCrackedFileSystemURL( | 119 move_src_ = file_system_context_->CreateCrackedFileSystemURL( |
120 GURL(kOrigin), fileapi::kFileSystemTypeTest, | 120 GURL(kOrigin), fileapi::kFileSystemTypeTest, |
121 base::FilePath::FromUTF8Unsafe(filename)); | 121 base::FilePath::FromUTF8Unsafe(filename)); |
122 | 122 |
123 test_file_size_ = content.size(); | 123 test_file_size_ = content.size(); |
124 base::FilePath test_file = src_path.AppendASCII(filename); | 124 base::FilePath test_file = src_path.AppendASCII(filename); |
125 ASSERT_EQ(test_file_size_, | 125 ASSERT_EQ(test_file_size_, |
126 file_util::WriteFile(test_file, content.data(), test_file_size_)); | 126 base::WriteFile(test_file, content.data(), test_file_size_)); |
127 | 127 |
128 base::FilePath dest_path = base.AppendASCII("dest_fs"); | 128 base::FilePath dest_path = base.AppendASCII("dest_fs"); |
129 ASSERT_TRUE(base::CreateDirectory(dest_path)); | 129 ASSERT_TRUE(base::CreateDirectory(dest_path)); |
130 std::string dest_fsid = | 130 std::string dest_fsid = |
131 fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath( | 131 fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath( |
132 fileapi::kFileSystemTypeNativeMedia, dest_path, NULL); | 132 fileapi::kFileSystemTypeNativeMedia, dest_path, NULL); |
133 | 133 |
134 size_t extension_index = filename.find_last_of("."); | 134 size_t extension_index = filename.find_last_of("."); |
135 ASSERT_NE(std::string::npos, extension_index); | 135 ASSERT_NE(std::string::npos, extension_index); |
136 std::string extension = filename.substr(extension_index); | 136 std::string extension = filename.substr(extension_index); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 test_file = test_file.AppendASCII("no_streams.webm"); | 270 test_file = test_file.AppendASCII("no_streams.webm"); |
271 MoveTestFromFile("no_streams.webm", test_file, false); | 271 MoveTestFromFile("no_streams.webm", test_file, false); |
272 } | 272 } |
273 | 273 |
274 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { | 274 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { |
275 base::FilePath test_file = GetMediaTestDir(); | 275 base::FilePath test_file = GetMediaTestDir(); |
276 ASSERT_FALSE(test_file.empty()); | 276 ASSERT_FALSE(test_file.empty()); |
277 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); | 277 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); |
278 MoveTestFromFile("multitrack.webm", test_file, true); | 278 MoveTestFromFile("multitrack.webm", test_file, true); |
279 } | 279 } |
OLD | NEW |