OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 10 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
11 #include "chrome/browser/policy/configuration_policy_reader.h" | 11 #include "chrome/browser/policy/configuration_policy_reader.h" |
12 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 12 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
13 #include "chrome/browser/policy/mock_configuration_policy_reader.h" | 13 #include "chrome/browser/policy/mock_configuration_policy_reader.h" |
14 #include "policy/policy_constants.h" | 14 #include "policy/policy_constants.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 using ::testing::Return; | 17 using ::testing::Return; |
18 using ::testing::ReturnNull; | 18 using ::testing::ReturnNull; |
19 using ::testing::_; | 19 using ::testing::_; |
20 | 20 |
21 namespace policy { | 21 namespace policy { |
22 | 22 |
23 class ConfigurationPolicyReaderTest : public testing::Test { | 23 class ConfigurationPolicyReaderTest : public testing::Test { |
24 protected: | 24 protected: |
25 ConfigurationPolicyReaderTest() : provider_() { | 25 ConfigurationPolicyReaderTest() : provider_() { |
26 managed_reader_.reset( | 26 managed_reader_.reset( |
27 new ConfigurationPolicyReader(&provider_, PolicyStatusInfo::MANDATORY)); | 27 new ConfigurationPolicyReader(&provider_, PolicyStatusInfo::MANDATORY)); |
28 recommended_reader_.reset(new ConfigurationPolicyReader(&provider_, | 28 recommended_reader_.reset(new ConfigurationPolicyReader(&provider_, |
29 PolicyStatusInfo::RECOMMENDED)); | 29 PolicyStatusInfo::RECOMMENDED)); |
30 status_ok_ = ASCIIToUTF16("ok"); | 30 status_ok_ = ASCIIToUTF16("OK"); |
Mattias Nissler (ping if slow)
2011/10/28 15:18:51
If you think OK is better then ok, then also pleas
Joao da Silva
2011/10/28 15:45:00
Done.
| |
31 } | 31 } |
32 | 32 |
33 DictionaryValue* CreateDictionary(const char* policy_name, | 33 DictionaryValue* CreateDictionary(const char* policy_name, |
34 Value* policy_value) { | 34 Value* policy_value) { |
35 DictionaryValue* dict = new DictionaryValue(); | 35 DictionaryValue* dict = new DictionaryValue(); |
36 dict->SetString(std::string(PolicyStatusInfo::kNameDictPath), | 36 dict->SetString(std::string(PolicyStatusInfo::kNameDictPath), |
37 ASCIIToUTF16(policy_name)); | 37 ASCIIToUTF16(policy_name)); |
38 dict->SetString(std::string(PolicyStatusInfo::kLevelDictPath), | 38 dict->SetString(std::string(PolicyStatusInfo::kLevelDictPath), |
39 PolicyStatusInfo::GetPolicyLevelString(PolicyStatusInfo::MANDATORY)); | 39 PolicyStatusInfo::GetPolicyLevelString(PolicyStatusInfo::MANDATORY)); |
40 dict->SetString(std::string(PolicyStatusInfo::kSourceTypeDictPath), | 40 dict->SetString(std::string(PolicyStatusInfo::kSourceTypeDictPath), |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
337 entry->name, | 337 entry->name, |
338 false, | 338 false, |
339 PolicyStatusInfo::LEVEL_UNDEFINED); | 339 PolicyStatusInfo::LEVEL_UNDEFINED); |
340 EXPECT_TRUE(undefined_dict->Equals(status_dict)); | 340 EXPECT_TRUE(undefined_dict->Equals(status_dict)); |
341 break; | 341 break; |
342 } | 342 } |
343 } | 343 } |
344 } | 344 } |
345 | 345 |
346 } // namespace policy | 346 } // namespace policy |
OLD | NEW |