OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/extensions/management_policy.h" | 6 #include "chrome/browser/extensions/management_policy.h" |
7 #include "chrome/browser/extensions/test_management_policy.h" | 7 #include "chrome/browser/extensions/test_management_policy.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 typedef extensions::TestManagementPolicyProvider TestProvider; | 10 typedef extensions::TestManagementPolicyProvider TestProvider; |
11 using extensions::Extension; | 11 using extensions::Extension; |
12 | 12 |
13 class ManagementPolicyTest : public testing::Test { | 13 class ManagementPolicyTest : public testing::Test { |
14 public: | 14 public: |
15 void SetUp() { | 15 virtual void SetUp() { |
16 allow_all_.SetProhibitedActions(TestProvider::ALLOW_ALL); | 16 allow_all_.SetProhibitedActions(TestProvider::ALLOW_ALL); |
17 no_modify_status_.SetProhibitedActions( | 17 no_modify_status_.SetProhibitedActions( |
18 TestProvider::PROHIBIT_MODIFY_STATUS); | 18 TestProvider::PROHIBIT_MODIFY_STATUS); |
19 no_load_.SetProhibitedActions(TestProvider::PROHIBIT_LOAD); | 19 no_load_.SetProhibitedActions(TestProvider::PROHIBIT_LOAD); |
20 must_remain_enabled_.SetProhibitedActions( | 20 must_remain_enabled_.SetProhibitedActions( |
21 TestProvider::MUST_REMAIN_ENABLED); | 21 TestProvider::MUST_REMAIN_ENABLED); |
22 restrict_all_.SetProhibitedActions(TestProvider::PROHIBIT_MODIFY_STATUS | | 22 restrict_all_.SetProhibitedActions(TestProvider::PROHIBIT_MODIFY_STATUS | |
23 TestProvider::PROHIBIT_LOAD | | 23 TestProvider::PROHIBIT_LOAD | |
24 TestProvider::MUST_REMAIN_ENABLED); | 24 TestProvider::MUST_REMAIN_ENABLED); |
25 } | 25 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 error = original_error16; | 168 error = original_error16; |
169 EXPECT_FALSE(policy_.UserMayLoad(NULL, &error)); | 169 EXPECT_FALSE(policy_.UserMayLoad(NULL, &error)); |
170 EXPECT_EQ(UTF8ToUTF16(TestProvider::expected_error()), error); | 170 EXPECT_EQ(UTF8ToUTF16(TestProvider::expected_error()), error); |
171 error = original_error16; | 171 error = original_error16; |
172 EXPECT_FALSE(policy_.UserMayModifySettings(NULL, &error)); | 172 EXPECT_FALSE(policy_.UserMayModifySettings(NULL, &error)); |
173 EXPECT_EQ(UTF8ToUTF16(TestProvider::expected_error()), error); | 173 EXPECT_EQ(UTF8ToUTF16(TestProvider::expected_error()), error); |
174 error = original_error16; | 174 error = original_error16; |
175 EXPECT_TRUE(policy_.MustRemainEnabled(NULL, &error)); | 175 EXPECT_TRUE(policy_.MustRemainEnabled(NULL, &error)); |
176 EXPECT_EQ(UTF8ToUTF16(TestProvider::expected_error()), error); | 176 EXPECT_EQ(UTF8ToUTF16(TestProvider::expected_error()), error); |
177 } | 177 } |
OLD | NEW |