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 "chrome/browser/managed_mode/managed_mode.h" | 5 #include "chrome/browser/managed_mode/managed_mode.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 TEST_F(ManagedModeTest, Cancelled) { | 226 TEST_F(ManagedModeTest, Cancelled) { |
227 BrowserFixture managed_mode_browser(&managed_mode_, &managed_mode_profile_); | 227 BrowserFixture managed_mode_browser(&managed_mode_, &managed_mode_profile_); |
228 BrowserFixture other_browser(&managed_mode_, &other_profile_); | 228 BrowserFixture other_browser(&managed_mode_, &other_profile_); |
229 | 229 |
230 // If the user cancelled entering managed mode, it should fail immediately. | 230 // If the user cancelled entering managed mode, it should fail immediately. |
231 managed_mode_.set_should_cancel_enter(true); | 231 managed_mode_.set_should_cancel_enter(true); |
232 managed_mode_.EnterManagedModeForTesting(&managed_mode_profile_, | 232 managed_mode_.EnterManagedModeForTesting(&managed_mode_profile_, |
233 CreateExpectedCallback(false)); | 233 CreateExpectedCallback(false)); |
234 } | 234 } |
235 | |
236 TEST_F(ManagedModeTest, ExtensionManagementPolicyProvider) { | |
237 BrowserFixture managed_mode_browser(&managed_mode_, &managed_mode_profile_); | |
238 | |
239 { | |
240 string16 error; | |
241 EXPECT_TRUE(managed_mode_.UserMayLoad(NULL, &error)); | |
242 EXPECT_EQ(string16(), error); | |
243 } | |
244 { | |
245 string16 error; | |
246 EXPECT_TRUE(managed_mode_.UserMayModifySettings(NULL, &error)); | |
247 EXPECT_EQ(string16(), error); | |
248 } | |
249 | |
250 managed_mode_.SetInManagedMode(&managed_mode_profile_); | |
251 { | |
252 string16 error; | |
253 EXPECT_FALSE(managed_mode_.UserMayLoad(NULL, &error)); | |
254 EXPECT_FALSE(error.empty()); | |
255 } | |
256 { | |
257 string16 error; | |
258 EXPECT_FALSE(managed_mode_.UserMayModifySettings(NULL, &error)); | |
259 EXPECT_FALSE(error.empty()); | |
260 } | |
261 | |
262 #ifndef NDEBUG | |
263 EXPECT_FALSE(managed_mode_.GetDebugPolicyProviderName().empty()); | |
264 #endif | |
265 } | |
OLD | NEW |