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
3 // found in the LICENSE file.
5 #include "chromeos/network/onc/onc_normalizer.h"
7 #include "base/memory/scoped_ptr.h"
8 #include "base/values.h"
9 #include "chromeos/network/onc/onc_signature.h"
10 #include "chromeos/network/onc/onc_test_utils.h"
11 #include "testing/gtest/include/gtest/gtest.h"
16 // This test case is about validating valid ONC objects.
17 TEST(ONCNormalizerTest
, NormalizeNetworkConfiguration
) {
18 Normalizer
normalizer(true);
19 scoped_ptr
<const base::DictionaryValue
> data(
20 test_utils::ReadTestDictionary("settings_with_normalization.json"));
22 const base::DictionaryValue
* original
= NULL
;
23 const base::DictionaryValue
* expected_normalized
= NULL
;
24 data
->GetDictionary("ethernet-and-vpn", &original
);
25 data
->GetDictionary("ethernet-and-vpn-normalized", &expected_normalized
);
27 scoped_ptr
<base::DictionaryValue
> actual_normalized
=
28 normalizer
.NormalizeObject(&kNetworkConfigurationSignature
, *original
);
29 EXPECT_TRUE(test_utils::Equals(expected_normalized
, actual_normalized
.get()));
33 } // namespace chromeos