Some additional network settings cleanup
[chromium-blink-merge.git] / chromeos / network / network_ui_data_unittest.cc
blob0617643fb3b09b6b570e4491838084ae22d394af
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/network_ui_data.h"
7 #include "base/values.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 namespace chromeos {
12 TEST(NetworkUIDataTest, ONCSource) {
13 base::DictionaryValue ui_data_dict;
15 ui_data_dict.SetString(NetworkUIData::kKeyONCSource, "user_import");
17 NetworkUIData ui_data(ui_data_dict);
18 EXPECT_EQ(::onc::ONC_SOURCE_USER_IMPORT, ui_data.onc_source());
21 ui_data_dict.SetString(NetworkUIData::kKeyONCSource, "device_policy");
23 NetworkUIData ui_data(ui_data_dict);
24 EXPECT_EQ(::onc::ONC_SOURCE_DEVICE_POLICY, ui_data.onc_source());
26 ui_data_dict.SetString(NetworkUIData::kKeyONCSource, "user_policy");
28 NetworkUIData ui_data(ui_data_dict);
29 EXPECT_EQ(::onc::ONC_SOURCE_USER_POLICY, ui_data.onc_source());
33 } // namespace chromeos