Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: chrome/browser/managed_mode/managed_mode_unittest.cc

Issue 11826059: Add ManagedUserService for profile-specific managed user data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698