Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc

Issue 341043008: Add FileSystemID parameter to IsolatedContext::RegisterFileSystemForPath. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 base::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, std::string(), dest_path,
133 NULL);
133 134
134 size_t extension_index = filename.find_last_of("."); 135 size_t extension_index = filename.find_last_of(".");
135 ASSERT_NE(std::string::npos, extension_index); 136 ASSERT_NE(std::string::npos, extension_index);
136 std::string extension = filename.substr(extension_index); 137 std::string extension = filename.substr(extension_index);
137 std::string dest_root_fs_url = fileapi::GetIsolatedFileSystemRootURIString( 138 std::string dest_root_fs_url = fileapi::GetIsolatedFileSystemRootURIString(
138 GURL(kOrigin), dest_fsid, "dest_fs/"); 139 GURL(kOrigin), dest_fsid, "dest_fs/");
139 move_dest_ = file_system_context_->CrackURL(GURL( 140 move_dest_ = file_system_context_->CrackURL(GURL(
140 dest_root_fs_url + "move_dest" + extension)); 141 dest_root_fs_url + "move_dest" + extension));
141 142
142 content::BrowserThread::PostTask( 143 content::BrowserThread::PostTask(
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 test_file = test_file.AppendASCII("no_streams.webm"); 271 test_file = test_file.AppendASCII("no_streams.webm");
271 MoveTestFromFile("no_streams.webm", test_file, false); 272 MoveTestFromFile("no_streams.webm", test_file, false);
272 } 273 }
273 274
274 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) { 275 IN_PROC_BROWSER_TEST_F(MediaFileValidatorTest, ValidVideo) {
275 base::FilePath test_file = GetMediaTestDir(); 276 base::FilePath test_file = GetMediaTestDir();
276 ASSERT_FALSE(test_file.empty()); 277 ASSERT_FALSE(test_file.empty());
277 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm"); 278 test_file = test_file.AppendASCII("bear-320x240-multitrack.webm");
278 MoveTestFromFile("multitrack.webm", test_file, true); 279 MoveTestFromFile("multitrack.webm", test_file, true);
279 } 280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698