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

Side by Side Diff: chromeos/network/onc/onc_test_utils.cc

Issue 16946002: Resolve certificate references in ONC by PEM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a unit test for the resolve function. 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 | « chromeos/network/onc/onc_test_utils.h ('k') | chromeos/network/onc/onc_translation_tables.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 "chromeos/network/onc/onc_test_utils.h" 5 #include "chromeos/network/onc/onc_test_utils.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/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 CHECK(content != NULL) << "Couldn't json-deserialize file '" 57 CHECK(content != NULL) << "Couldn't json-deserialize file '"
58 << filename << "': " << error_message; 58 << filename << "': " << error_message;
59 59
60 CHECK(content->GetAsDictionary(&dict)) 60 CHECK(content->GetAsDictionary(&dict))
61 << "File '" << filename 61 << "File '" << filename
62 << "' does not contain a dictionary as expected, but type " 62 << "' does not contain a dictionary as expected, but type "
63 << content->GetType(); 63 << content->GetType();
64 return make_scoped_ptr(dict); 64 return make_scoped_ptr(dict);
65 } 65 }
66 66
67 ::testing::AssertionResult Equals(const base::DictionaryValue* expected, 67 ::testing::AssertionResult Equals(const base::Value* expected,
68 const base::DictionaryValue* actual) { 68 const base::Value* actual) {
69 CHECK(expected != NULL); 69 CHECK(expected != NULL);
70 if (actual == NULL) 70 if (actual == NULL)
71 return ::testing::AssertionFailure() << "Actual dictionary pointer is NULL"; 71 return ::testing::AssertionFailure() << "Actual value pointer is NULL";
72 72
73 if (expected->Equals(actual)) 73 if (expected->Equals(actual))
74 return ::testing::AssertionSuccess() << "Dictionaries are equal"; 74 return ::testing::AssertionSuccess() << "Values are equal";
75 75
76 return ::testing::AssertionFailure() << "Dictionaries are unequal.\n" 76 return ::testing::AssertionFailure() << "Values are unequal.\n"
77 << "Expected dictionary:\n" << *expected 77 << "Expected value:\n" << *expected
78 << "Actual dictionary:\n" << *actual; 78 << "Actual value:\n" << *actual;
79 } 79 }
80 80
81 } // namespace test_utils 81 } // namespace test_utils
82 } // namespace onc 82 } // namespace onc
83 } // namespace chromeos 83 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_test_utils.h ('k') | chromeos/network/onc/onc_translation_tables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698