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

Unified Diff: chrome/browser/ui/webui/options/managed_user_settings_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/options/managed_user_settings_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/managed_user_settings_test.cc
diff --git a/chrome/browser/ui/webui/options/managed_user_settings_test.cc b/chrome/browser/ui/webui/options/managed_user_settings_test.cc
index 5d8e2d0b3899df55b99739512a3b9c84daee429e..de24d8e5c9d3d577a7db8b8de0aa5aec1c349dba 100644
--- a/chrome/browser/ui/webui/options/managed_user_settings_test.cc
+++ b/chrome/browser/ui/webui/options/managed_user_settings_test.cc
@@ -5,7 +5,14 @@
#include "chrome/browser/ui/webui/options/managed_user_settings_test.h"
#include "base/command_line.h"
+#include "base/prefs/pref_service.h"
+#include "chrome/browser/managed_mode/managed_mode_navigation_observer.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
+#include "content/public/browser/web_contents.h"
ManagedUserSettingsTest::ManagedUserSettingsTest() {
}
@@ -13,6 +20,18 @@ ManagedUserSettingsTest::ManagedUserSettingsTest() {
ManagedUserSettingsTest::~ManagedUserSettingsTest() {
}
+void ManagedUserSettingsTest::SetUpOnMainThread() {
+ WebUIBrowserTest::SetUpOnMainThread();
+ // Set up the ManagedModeNavigationObserver manually since the profile was
+ // not managed when the browser was created.
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ ManagedModeNavigationObserver::CreateForWebContents(web_contents);
+
+ Profile* profile = browser()->profile();
+ profile->GetPrefs()->SetBoolean(prefs::kProfileIsManaged, true);
+}
+
void ManagedUserSettingsTest::SetUpCommandLine(CommandLine* command_line) {
command_line->AppendSwitch(switches::kManaged);
command_line->AppendSwitch(switches::kEnableManagedUsers);
« no previous file with comments | « chrome/browser/ui/webui/options/managed_user_settings_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698