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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 23868042: Mark supervised profiles as such immediately when they're created. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 2 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL()); 953 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL());
954 EXPECT_EQ(1U, 954 EXPECT_EQ(1U,
955 InfoBarService::FromWebContents(web_contents)->infobar_count()); 955 InfoBarService::FromWebContents(web_contents)->infobar_count());
956 } 956 }
957 957
958 class ManagedModeBrowserCreatorTest : public InProcessBrowserTest { 958 class ManagedModeBrowserCreatorTest : public InProcessBrowserTest {
959 protected: 959 protected:
960 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 960 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
961 InProcessBrowserTest::SetUpCommandLine(command_line); 961 InProcessBrowserTest::SetUpCommandLine(command_line);
962 command_line->AppendSwitch(switches::kEnableManagedUsers); 962 command_line->AppendSwitch(switches::kEnableManagedUsers);
963 command_line->AppendSwitch(switches::kNewProfileIsSupervised);
963 } 964 }
964 }; 965 };
965 966
966 IN_PROC_BROWSER_TEST_F(ManagedModeBrowserCreatorTest, 967 IN_PROC_BROWSER_TEST_F(ManagedModeBrowserCreatorTest,
967 StartupManagedModeProfile) { 968 StartupManagedModeProfile) {
968 // Make this a managed profile.
969 ManagedUserService* managed_user_service =
970 ManagedUserServiceFactory::GetForProfile(browser()->profile());
971 managed_user_service->InitForTesting();
972
973 StartupBrowserCreator browser_creator; 969 StartupBrowserCreator browser_creator;
974 970
975 // Do a simple non-process-startup browser launch. 971 // Do a simple non-process-startup browser launch.
976 CommandLine dummy(CommandLine::NO_PROGRAM); 972 CommandLine dummy(CommandLine::NO_PROGRAM);
977 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, 973 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
978 chrome::startup::IS_FIRST_RUN); 974 chrome::startup::IS_FIRST_RUN);
979 content::WindowedNotificationObserver observer( 975 content::WindowedNotificationObserver observer(
980 content::NOTIFICATION_LOAD_STOP, 976 content::NOTIFICATION_LOAD_STOP,
981 content::NotificationService::AllSources()); 977 content::NotificationService::AllSources());
982 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, 978 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false,
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 ASSERT_EQ(1, tab_strip->count()); 1334 ASSERT_EQ(1, tab_strip->count());
1339 EXPECT_EQ("title1.html", 1335 EXPECT_EQ("title1.html",
1340 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); 1336 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName());
1341 } 1337 }
1342 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1338 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1343 1339
1344 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || 1340 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) ||
1345 // defined(ENABLE_CONFIGURATION_POLICY) 1341 // defined(ENABLE_CONFIGURATION_POLICY)
1346 1342
1347 #endif // !defined(OS_CHROMEOS) 1343 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698