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

Side by Side Diff: chrome/common/json_schema/json_schema_validator_unittest_base.cc

Issue 18286004: Move PathExists to base namespace. (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/extensions/unpacker_unittest.cc ('k') | chrome/common/logging_chrome.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 (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/common/json_schema/json_schema_validator_unittest_base.h" 5 #include "chrome/common/json_schema/json_schema_validator_unittest_base.h"
6 6
7 #include <cfloat> 7 #include <cfloat>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 11 matching lines...) Expand all
22 namespace schema = json_schema_constants; 22 namespace schema = json_schema_constants;
23 23
24 namespace { 24 namespace {
25 25
26 #define TEST_SOURCE base::StringPrintf("%s:%i", __FILE__, __LINE__) 26 #define TEST_SOURCE base::StringPrintf("%s:%i", __FILE__, __LINE__)
27 27
28 base::Value* LoadValue(const std::string& filename) { 28 base::Value* LoadValue(const std::string& filename) {
29 base::FilePath path; 29 base::FilePath path;
30 PathService::Get(chrome::DIR_TEST_DATA, &path); 30 PathService::Get(chrome::DIR_TEST_DATA, &path);
31 path = path.AppendASCII("json_schema_validator").AppendASCII(filename); 31 path = path.AppendASCII("json_schema_validator").AppendASCII(filename);
32 EXPECT_TRUE(file_util::PathExists(path)); 32 EXPECT_TRUE(base::PathExists(path));
33 33
34 std::string error_message; 34 std::string error_message;
35 JSONFileValueSerializer serializer(path); 35 JSONFileValueSerializer serializer(path);
36 base::Value* result = serializer.Deserialize(NULL, &error_message); 36 base::Value* result = serializer.Deserialize(NULL, &error_message);
37 if (!result) 37 if (!result)
38 ADD_FAILURE() << "Could not parse JSON: " << error_message; 38 ADD_FAILURE() << "Could not parse JSON: " << error_message;
39 return result; 39 return result;
40 } 40 }
41 41
42 base::Value* LoadValue(const std::string& filename, base::Value::Type type) { 42 base::Value* LoadValue(const std::string& filename, base::Value::Type type) {
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 schema->SetString(schema::kType, schema::kNull); 717 schema->SetString(schema::kType, schema::kNull);
718 ExpectNotValid( 718 ExpectNotValid(
719 TEST_SOURCE, 719 TEST_SOURCE,
720 scoped_ptr<base::Value>(new base::FundamentalValue(false)).get(), 720 scoped_ptr<base::Value>(new base::FundamentalValue(false)).get(),
721 schema.get(), 721 schema.get(),
722 NULL, 722 NULL,
723 std::string(), 723 std::string(),
724 JSONSchemaValidator::FormatErrorMessage( 724 JSONSchemaValidator::FormatErrorMessage(
725 JSONSchemaValidator::kInvalidType, schema::kNull, schema::kBoolean)); 725 JSONSchemaValidator::kInvalidType, schema::kNull, schema::kBoolean));
726 } 726 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/unpacker_unittest.cc ('k') | chrome/common/logging_chrome.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698