| 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 <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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); | 991 new_browser = FindOneOtherBrowserForProfile(profile_urls, NULL); |
| 992 ASSERT_TRUE(new_browser); | 992 ASSERT_TRUE(new_browser); |
| 993 tab_strip = new_browser->tab_strip_model(); | 993 tab_strip = new_browser->tab_strip_model(); |
| 994 ASSERT_EQ(1, tab_strip->count()); | 994 ASSERT_EQ(1, tab_strip->count()); |
| 995 web_contents = tab_strip->GetWebContentsAt(0); | 995 web_contents = tab_strip->GetWebContentsAt(0); |
| 996 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL()); | 996 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL()); |
| 997 infobar_service = InfoBarService::FromWebContents(web_contents); | 997 infobar_service = InfoBarService::FromWebContents(web_contents); |
| 998 EXPECT_EQ(1U, infobar_service->infobar_count()); | 998 EXPECT_EQ(1U, infobar_service->infobar_count()); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 class ManagedModeBrowserCreatorTest : public InProcessBrowserTest { | 1001 class SupervisedUserBrowserCreatorTest : public InProcessBrowserTest { |
| 1002 protected: | 1002 protected: |
| 1003 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 1003 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 1004 InProcessBrowserTest::SetUpCommandLine(command_line); | 1004 InProcessBrowserTest::SetUpCommandLine(command_line); |
| 1005 command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); | 1005 command_line->AppendSwitchASCII(switches::kSupervisedUserId, "asdf"); |
| 1006 } | 1006 } |
| 1007 }; | 1007 }; |
| 1008 | 1008 |
| 1009 IN_PROC_BROWSER_TEST_F(ManagedModeBrowserCreatorTest, | 1009 IN_PROC_BROWSER_TEST_F(SupervisedUserBrowserCreatorTest, |
| 1010 StartupManagedModeProfile) { | 1010 StartupSupervisedUserProfile) { |
| 1011 StartupBrowserCreator browser_creator; | 1011 StartupBrowserCreator browser_creator; |
| 1012 | 1012 |
| 1013 // Do a simple non-process-startup browser launch. | 1013 // Do a simple non-process-startup browser launch. |
| 1014 CommandLine dummy(CommandLine::NO_PROGRAM); | 1014 CommandLine dummy(CommandLine::NO_PROGRAM); |
| 1015 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, | 1015 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, |
| 1016 chrome::startup::IS_FIRST_RUN); | 1016 chrome::startup::IS_FIRST_RUN); |
| 1017 content::WindowedNotificationObserver observer( | 1017 content::WindowedNotificationObserver observer( |
| 1018 content::NOTIFICATION_LOAD_STOP, | 1018 content::NOTIFICATION_LOAD_STOP, |
| 1019 content::NotificationService::AllSources()); | 1019 content::NotificationService::AllSources()); |
| 1020 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, | 1020 ASSERT_TRUE(launch.Launch(browser()->profile(), std::vector<GURL>(), false, |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 ASSERT_EQ(1, tab_strip->count()); | 1434 ASSERT_EQ(1, tab_strip->count()); |
| 1435 EXPECT_EQ("title1.html", | 1435 EXPECT_EQ("title1.html", |
| 1436 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 1436 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
| 1437 } | 1437 } |
| 1438 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 1438 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
| 1439 | 1439 |
| 1440 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || | 1440 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || |
| 1441 // defined(ENABLE_CONFIGURATION_POLICY) | 1441 // defined(ENABLE_CONFIGURATION_POLICY) |
| 1442 | 1442 |
| 1443 #endif // !defined(OS_CHROMEOS) | 1443 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |