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

Unified Diff: chromeos/network/onc_test_utils.cc

Issue 11299236: This moves the ONC parsing code into chromeos/network/onc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
Index: chromeos/network/onc_test_utils.cc
diff --git a/chrome/browser/chromeos/network_settings/onc_test_utils.cc b/chromeos/network/onc_test_utils.cc
similarity index 87%
rename from chrome/browser/chromeos/network_settings/onc_test_utils.cc
rename to chromeos/network/onc_test_utils.cc
index d76fbfa9d5ddf07fafe521194209ddc4480634a5..603d5b6aad0d73cbe7ddb0b886b77bed49af30ec 100644
--- a/chrome/browser/chromeos/network_settings/onc_test_utils.cc
+++ b/chromeos/network/onc_test_utils.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/network_settings/onc_test_utils.h"
+#include "chromeos/network/onc_test_utils.h"
#include "base/file_path.h"
#include "base/json/json_file_value_serializer.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/values.h"
-#include "chrome/common/chrome_paths.h"
+#include "chromeos/chromeos_test_utils.h"
namespace chromeos {
namespace onc {
@@ -17,10 +17,11 @@ namespace test_utils {
scoped_ptr<base::DictionaryValue> ReadTestDictionary(
const std::string& filename) {
+ base::DictionaryValue* dict = NULL;
FilePath path;
- PathService::Get(chrome::DIR_TEST_DATA, &path);
- path = path.AppendASCII("chromeos").AppendASCII("network_settings").
- Append(filename);
+ if (!chromeos::test_utils::GetTestDataPath(filename, &path))
+ return make_scoped_ptr(dict);
+
JSONFileValueSerializer serializer(path);
serializer.set_allow_trailing_comma(true);
@@ -29,7 +30,6 @@ scoped_ptr<base::DictionaryValue> ReadTestDictionary(
CHECK(content != NULL) << "Couldn't json-deserialize file '"
<< filename << "': " << error_message;
- base::DictionaryValue* dict = NULL;
CHECK(content->GetAsDictionary(&dict))
<< "File '" << filename
<< "' does not contain a dictionary as expected, but type "

Powered by Google App Engine
This is Rietveld 408576698