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

Unified Diff: chrome/browser/chromeos/network_settings/onc_normalizer_unittest.cc

Issue 10944009: Implementation of ONC signature, validator and normalizer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@gperffix
Patch Set: Addressed remaining nits. 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: chrome/browser/chromeos/network_settings/onc_normalizer_unittest.cc
diff --git a/chrome/browser/chromeos/network_settings/onc_normalizer_unittest.cc b/chrome/browser/chromeos/network_settings/onc_normalizer_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2aa7889db6af1e7b1f126704f396969b85bc0162
--- /dev/null
+++ b/chrome/browser/chromeos/network_settings/onc_normalizer_unittest.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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_normalizer.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
+#include "chrome/browser/chromeos/network_settings/onc_signature.h"
+#include "chrome/browser/chromeos/network_settings/onc_test_utils.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromeos {
+namespace onc {
+
+// This test case is about validating valid ONC objects.
+TEST(ONCNormalizerTest, NormalizeNetworkConfiguration) {
+ Normalizer normalizer(true);
+ scoped_ptr<const base::DictionaryValue> data(
+ test_utils::ReadTestDictionary("settings_with_normalization.json"));
+
+ const base::DictionaryValue* original;
+ const base::DictionaryValue* expected_normalized;
+ data->GetDictionary("ethernet-and-vpn", &original);
+ data->GetDictionary("ethernet-and-vpn-normalized", &expected_normalized);
+
+ scoped_ptr<base::DictionaryValue> actual_normalized =
+ normalizer.NormalizeObject(&kNetworkConfigurationSignature, *original);
+ EXPECT_TRUE(test_utils::Equals(expected_normalized, actual_normalized.get()));
+}
+
+} // namespace onc
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/network_settings/onc_normalizer.cc ('k') | chrome/browser/chromeos/network_settings/onc_signature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698