OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" | 10 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 scoped_ptr<base::ListValue> urls(new base::ListValue); | 60 scoped_ptr<base::ListValue> urls(new base::ListValue); |
61 urls->AppendString(kStartUpURL1); | 61 urls->AppendString(kStartUpURL1); |
62 urls->AppendString(kStartUpURL2); | 62 urls->AppendString(kStartUpURL2); |
63 policy->Set(key::kRestoreOnStartupURLs, urls.Pass()); | 63 policy->Set(key::kRestoreOnStartupURLs, urls.Pass()); |
64 } | 64 } |
65 | 65 |
66 void RestoreOnStartupTestChromeOS::LogInAndVerifyStartUpURLs() { | 66 void RestoreOnStartupTestChromeOS::LogInAndVerifyStartUpURLs() { |
67 LogIn(kAccountId, kAccountPassword); | 67 LogIn(kAccountId, kAccountPassword); |
68 | 68 |
69 const BrowserList* const browser_list = | 69 const BrowserList* const browser_list = |
70 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 70 BrowserList::GetInstance(ui::HOST_DESKTOP_TYPE_ASH); |
71 ASSERT_EQ(1U, browser_list->size()); | 71 ASSERT_EQ(1U, browser_list->size()); |
72 const Browser* const browser = browser_list->get(0); | 72 const Browser* const browser = browser_list->get(0); |
73 ASSERT_TRUE(browser); | 73 ASSERT_TRUE(browser); |
74 const TabStripModel* tabs = browser->tab_strip_model(); | 74 const TabStripModel* tabs = browser->tab_strip_model(); |
75 ASSERT_TRUE(tabs); | 75 ASSERT_TRUE(tabs); |
76 ASSERT_EQ(2, tabs->count()); | 76 ASSERT_EQ(2, tabs->count()); |
77 EXPECT_EQ(GURL(kStartUpURL1), tabs->GetWebContentsAt(0)->GetURL()); | 77 EXPECT_EQ(GURL(kStartUpURL1), tabs->GetWebContentsAt(0)->GetURL()); |
78 EXPECT_EQ(GURL(kStartUpURL2), tabs->GetWebContentsAt(1)->GetURL()); | 78 EXPECT_EQ(GURL(kStartUpURL2), tabs->GetWebContentsAt(1)->GetURL()); |
79 } | 79 } |
80 | 80 |
81 // Verify that the policies are honored on a new user's login. | 81 // Verify that the policies are honored on a new user's login. |
82 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, PRE_LogInAndVerify) { | 82 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, PRE_LogInAndVerify) { |
83 SkipToLoginScreen(); | 83 SkipToLoginScreen(); |
84 LogInAndVerifyStartUpURLs(); | 84 LogInAndVerifyStartUpURLs(); |
85 } | 85 } |
86 | 86 |
87 // Verify that the policies are honored on an existing user's login. | 87 // Verify that the policies are honored on an existing user's login. |
88 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, LogInAndVerify) { | 88 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, LogInAndVerify) { |
89 content::WindowedNotificationObserver( | 89 content::WindowedNotificationObserver( |
90 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, | 90 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, |
91 content::NotificationService::AllSources()).Wait(); | 91 content::NotificationService::AllSources()).Wait(); |
92 LogInAndVerifyStartUpURLs(); | 92 LogInAndVerifyStartUpURLs(); |
93 } | 93 } |
94 | 94 |
95 } // namespace policy | 95 } // namespace policy |
OLD | NEW |