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

Side by Side Diff: chrome/common/extensions/api/storage/storage_schema_manifest_handler_unittest.cc

Issue 18584011: Rename base::Delete to base::DeleteFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
« no previous file with comments | « chrome/common/auto_start_linux.cc ('k') | chrome/common/extensions/extension_file_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/common/extensions/api/storage/storage_schema_manifest_handler.h " 5 #include "chrome/common/extensions/api/storage/storage_schema_manifest_handler.h "
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 26 matching lines...) Expand all
37 37
38 scoped_refptr<Extension> CreateExtension(const std::string& schema) { 38 scoped_refptr<Extension> CreateExtension(const std::string& schema) {
39 std::string error; 39 std::string error;
40 scoped_refptr<Extension> extension = Extension::Create( 40 scoped_refptr<Extension> extension = Extension::Create(
41 temp_dir_.path(), Manifest::UNPACKED, manifest_, 41 temp_dir_.path(), Manifest::UNPACKED, manifest_,
42 Extension::NO_FLAGS, "", &error); 42 Extension::NO_FLAGS, "", &error);
43 if (!extension.get()) 43 if (!extension.get())
44 return NULL; 44 return NULL;
45 base::FilePath schema_path = temp_dir_.path().AppendASCII("schema.json"); 45 base::FilePath schema_path = temp_dir_.path().AppendASCII("schema.json");
46 if (schema.empty()) { 46 if (schema.empty()) {
47 base::Delete(schema_path, false); 47 base::DeleteFile(schema_path, false);
48 } else { 48 } else {
49 if (file_util::WriteFile(schema_path, schema.data(), schema.size()) != 49 if (file_util::WriteFile(schema_path, schema.data(), schema.size()) !=
50 static_cast<int>(schema.size())) { 50 static_cast<int>(schema.size())) {
51 return NULL; 51 return NULL;
52 } 52 }
53 } 53 }
54 return extension; 54 return extension;
55 } 55 }
56 56
57 testing::AssertionResult Validates(const std::string& schema) { 57 testing::AssertionResult Validates(const std::string& schema) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 // All good now. 140 // All good now.
141 EXPECT_TRUE(Validates( 141 EXPECT_TRUE(Validates(
142 "{" 142 "{"
143 " \"$schema\": \"http://json-schema.org/draft-03/schema#\"," 143 " \"$schema\": \"http://json-schema.org/draft-03/schema#\","
144 " \"type\": \"object\"" 144 " \"type\": \"object\""
145 "}")); 145 "}"));
146 } 146 }
147 147
148 } // namespace extensions 148 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/auto_start_linux.cc ('k') | chrome/common/extensions/extension_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698