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

Side by Side Diff: chrome/browser/extensions/api/media_galleries/media_galleries_apitest.cc

Issue 102873002: Move GetFileSize, NormalizeFilePath to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/safe_numerics.h" 10 #include "base/safe_numerics.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 // Valid file, should show up in JS as a FileEntry. 149 // Valid file, should show up in JS as a FileEntry.
150 ASSERT_TRUE(base::CopyFile(test_data_path.AppendASCII("test.jpg"), 150 ASSERT_TRUE(base::CopyFile(test_data_path.AppendASCII("test.jpg"),
151 write_path.AppendASCII("test.jpg"))); 151 write_path.AppendASCII("test.jpg")));
152 152
153 // Invalid file, should not show up as a FileEntry in JS at all. 153 // Invalid file, should not show up as a FileEntry in JS at all.
154 ASSERT_TRUE(base::CopyFile(test_data_path.AppendASCII("test.txt"), 154 ASSERT_TRUE(base::CopyFile(test_data_path.AppendASCII("test.txt"),
155 write_path.AppendASCII("test.txt"))); 155 write_path.AppendASCII("test.txt")));
156 156
157 int64 file_size; 157 int64 file_size;
158 ASSERT_TRUE(file_util::GetFileSize(test_data_path.AppendASCII("test.jpg"), 158 ASSERT_TRUE(base::GetFileSize(test_data_path.AppendASCII("test.jpg"),
159 &file_size)); 159 &file_size));
160 test_jpg_size_ = base::checked_numeric_cast<int>(file_size); 160 test_jpg_size_ = base::checked_numeric_cast<int>(file_size);
161 } 161 }
162 162
163 #if defined(OS_WIN) || defined(OS_MACOSX) 163 #if defined(OS_WIN) || defined(OS_MACOSX)
164 void PopulatePicasaTestData(const base::FilePath& picasa_app_data_root) { 164 void PopulatePicasaTestData(const base::FilePath& picasa_app_data_root) {
165 base::FilePath picasa_database_path = 165 base::FilePath picasa_database_path =
166 picasa::MakePicasaDatabasePath(picasa_app_data_root); 166 picasa::MakePicasaDatabasePath(picasa_app_data_root);
167 base::FilePath picasa_temp_dir_path = 167 base::FilePath picasa_temp_dir_path =
168 picasa_database_path.DirName().AppendASCII(picasa::kPicasaTempDirName); 168 picasa_database_path.DirName().AppendASCII(picasa::kPicasaTempDirName);
169 ASSERT_TRUE(base::CreateDirectory(picasa_database_path)); 169 ASSERT_TRUE(base::CreateDirectory(picasa_database_path));
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest, 292 IN_PROC_BROWSER_TEST_F(MediaGalleriesPlatformAppBrowserTest,
293 PicasaCustomLocation) { 293 PicasaCustomLocation) {
294 base::ScopedTempDir custom_picasa_app_data_root; 294 base::ScopedTempDir custom_picasa_app_data_root;
295 ASSERT_TRUE(custom_picasa_app_data_root.CreateUniqueTempDir()); 295 ASSERT_TRUE(custom_picasa_app_data_root.CreateUniqueTempDir());
296 ensure_media_directories_exists()->SetCustomPicasaAppDataPath( 296 ensure_media_directories_exists()->SetCustomPicasaAppDataPath(
297 custom_picasa_app_data_root.path()); 297 custom_picasa_app_data_root.path());
298 PopulatePicasaTestData(custom_picasa_app_data_root.path()); 298 PopulatePicasaTestData(custom_picasa_app_data_root.path());
299 ASSERT_TRUE(RunMediaGalleriesTest("picasa")) << message_; 299 ASSERT_TRUE(RunMediaGalleriesTest("picasa")) << message_;
300 } 300 }
301 #endif // defined(OS_WIN) || defined(OS_MACOSX) 301 #endif // defined(OS_WIN) || defined(OS_MACOSX)
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/image_writer_private/operation_linux.cc ('k') | chrome/browser/extensions/sandboxed_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698