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

Unified Diff: chromeos/network/onc/onc_test_utils.cc

Issue 11578052: Replace OncNetworkParser by the new ONC translator. (Closed) Base URL: http://git.chromium.org/chromium/src.git@extend_onc_to_shill
Patch Set: Rebased. Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_test_utils.h ('k') | chromeos/network/onc/onc_validator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_test_utils.cc
diff --git a/chromeos/network/onc/onc_test_utils.cc b/chromeos/network/onc/onc_test_utils.cc
index 0a948bfc432555c6707011f86aee8bb97af24933..65bbd3d118dc1ae329fbdc88c993675575656aa4 100644
--- a/chromeos/network/onc/onc_test_utils.cc
+++ b/chromeos/network/onc/onc_test_utils.cc
@@ -5,6 +5,7 @@
#include "chromeos/network/onc/onc_test_utils.h"
#include "base/file_path.h"
+#include "base/file_util.h"
#include "base/json/json_file_value_serializer.h"
#include "base/logging.h"
#include "base/path_service.h"
@@ -22,6 +23,20 @@ const char kNetworkComponentDirectory[] = "network";
} // namespace
+std::string ReadTestData(const std::string& filename) {
+ FilePath path;
+ if (!chromeos::test_utils::GetTestDataPath(kNetworkComponentDirectory,
+ filename,
+ &path)) {
+ NOTREACHED() << "Unable to get test data path for "
+ << kNetworkComponentDirectory << "/" << filename;
+ return "";
+ }
+ std::string result;
+ file_util::ReadFileToString(path, &result);
+ return result;
+}
+
scoped_ptr<base::DictionaryValue> ReadTestDictionary(
const std::string& filename) {
base::DictionaryValue* dict = NULL;
« no previous file with comments | « chromeos/network/onc/onc_test_utils.h ('k') | chromeos/network/onc/onc_validator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698