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

Side by Side Diff: chrome/browser/sync/test/integration/sync_extension_helper.cc

Issue 99923002: Move temp file functions 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 "chrome/browser/sync/test/integration/sync_extension_helper.h" 5 #include "chrome/browser/sync/test/integration/sync_extension_helper.h"
6 6
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/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 ADD_FAILURE(); 305 ADD_FAILURE();
306 return NULL; 306 return NULL;
307 } 307 }
308 const base::FilePath sub_dir = base::FilePath().AppendASCII(name); 308 const base::FilePath sub_dir = base::FilePath().AppendASCII(name);
309 base::FilePath extension_dir; 309 base::FilePath extension_dir;
310 if (!base::PathExists(base_dir) && 310 if (!base::PathExists(base_dir) &&
311 !file_util::CreateDirectory(base_dir)) { 311 !file_util::CreateDirectory(base_dir)) {
312 ADD_FAILURE(); 312 ADD_FAILURE();
313 return NULL; 313 return NULL;
314 } 314 }
315 if (!file_util::CreateTemporaryDirInDir( 315 if (!base::CreateTemporaryDirInDir(base_dir, sub_dir.value(),
316 base_dir, sub_dir.value(), &extension_dir)) { 316 &extension_dir)) {
317 ADD_FAILURE(); 317 ADD_FAILURE();
318 return NULL; 318 return NULL;
319 } 319 }
320 std::string error; 320 std::string error;
321 scoped_refptr<Extension> extension = 321 scoped_refptr<Extension> extension =
322 Extension::Create(extension_dir, Manifest::INTERNAL, source, 322 Extension::Create(extension_dir, Manifest::INTERNAL, source,
323 Extension::NO_FLAGS, &error); 323 Extension::NO_FLAGS, &error);
324 if (!error.empty()) { 324 if (!error.empty()) {
325 ADD_FAILURE() << error; 325 ADD_FAILURE() << error;
326 return NULL; 326 return NULL;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 EXPECT_EQ(expected_id, extension->id()); 370 EXPECT_EQ(expected_id, extension->id());
371 return NULL; 371 return NULL;
372 } 372 }
373 DVLOG(2) << "created extension with name = " 373 DVLOG(2) << "created extension with name = "
374 << name << ", id = " << expected_id; 374 << name << ", id = " << expected_id;
375 (it->second)[name] = extension; 375 (it->second)[name] = extension;
376 id_to_name_[expected_id] = name; 376 id_to_name_[expected_id] = name;
377 id_to_type_[expected_id] = type; 377 id_to_type_[expected_id] = type;
378 return extension; 378 return extension;
379 } 379 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_win_unittest.cc ('k') | chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698