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

Side by Side Diff: chrome/browser/ui/webui/options/managed_user_set_passphrase_test.cc

Issue 13820009: Create a ManagedModeNavigationObserver only for managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the other test. Created 7 years, 8 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/ui/webui/options/managed_user_set_passphrase_test.h" 5 #include "chrome/browser/ui/webui/options/managed_user_set_passphrase_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
8 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/pref_names.h"
15 #include "content/public/browser/web_contents.h"
9 16
10 ManagedUserSetPassphraseTest::ManagedUserSetPassphraseTest() { 17 ManagedUserSetPassphraseTest::ManagedUserSetPassphraseTest() {
11 } 18 }
12 19
13 ManagedUserSetPassphraseTest::~ManagedUserSetPassphraseTest() { 20 ManagedUserSetPassphraseTest::~ManagedUserSetPassphraseTest() {
14 } 21 }
15 22
23 void ManagedUserSetPassphraseTest::SetUpOnMainThread() {
24 WebUIBrowserTest::SetUpOnMainThread();
25 // Set up the ManagedModeNavigationObserver manually since the profile was
26 // not managed when the browser was created.
27 content::WebContents* web_contents =
28 browser()->tab_strip_model()->GetActiveWebContents();
29 ManagedModeNavigationObserver::CreateForWebContents(web_contents);
30
31 Profile* profile = browser()->profile();
32 profile->GetPrefs()->SetBoolean(prefs::kProfileIsManaged, true);
33 }
34
16 void ManagedUserSetPassphraseTest::SetUpCommandLine(CommandLine* command_line) { 35 void ManagedUserSetPassphraseTest::SetUpCommandLine(CommandLine* command_line) {
17 command_line->AppendSwitch(switches::kManaged); 36 command_line->AppendSwitch(switches::kManaged);
18 command_line->AppendSwitch(switches::kEnableManagedUsers); 37 command_line->AppendSwitch(switches::kEnableManagedUsers);
19 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698