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

Side by Side Diff: chrome/browser/chromeos/policy/restore_on_startup_browsertest_chromeos.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: mac2 Created 4 years, 10 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
OLDNEW
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 <utility> 5 #include <utility>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 SessionStartupPref::kPrefValueURLs); 61 SessionStartupPref::kPrefValueURLs);
62 scoped_ptr<base::ListValue> urls(new base::ListValue); 62 scoped_ptr<base::ListValue> urls(new base::ListValue);
63 urls->AppendString(kStartUpURL1); 63 urls->AppendString(kStartUpURL1);
64 urls->AppendString(kStartUpURL2); 64 urls->AppendString(kStartUpURL2);
65 policy->Set(key::kRestoreOnStartupURLs, std::move(urls)); 65 policy->Set(key::kRestoreOnStartupURLs, std::move(urls));
66 } 66 }
67 67
68 void RestoreOnStartupTestChromeOS::LogInAndVerifyStartUpURLs() { 68 void RestoreOnStartupTestChromeOS::LogInAndVerifyStartUpURLs() {
69 LogIn(kAccountId, kAccountPassword); 69 LogIn(kAccountId, kAccountPassword);
70 70
71 const BrowserList* const browser_list = 71 const BrowserList* const browser_list = BrowserList::GetInstance();
72 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
73 ASSERT_EQ(1U, browser_list->size()); 72 ASSERT_EQ(1U, browser_list->size());
74 const Browser* const browser = browser_list->get(0); 73 const Browser* const browser = browser_list->get(0);
75 ASSERT_TRUE(browser); 74 ASSERT_TRUE(browser);
76 const TabStripModel* tabs = browser->tab_strip_model(); 75 const TabStripModel* tabs = browser->tab_strip_model();
77 ASSERT_TRUE(tabs); 76 ASSERT_TRUE(tabs);
78 ASSERT_EQ(2, tabs->count()); 77 ASSERT_EQ(2, tabs->count());
79 EXPECT_EQ(GURL(kStartUpURL1), tabs->GetWebContentsAt(0)->GetURL()); 78 EXPECT_EQ(GURL(kStartUpURL1), tabs->GetWebContentsAt(0)->GetURL());
80 EXPECT_EQ(GURL(kStartUpURL2), tabs->GetWebContentsAt(1)->GetURL()); 79 EXPECT_EQ(GURL(kStartUpURL2), tabs->GetWebContentsAt(1)->GetURL());
81 } 80 }
82 81
83 // Verify that the policies are honored on a new user's login. 82 // Verify that the policies are honored on a new user's login.
84 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, PRE_LogInAndVerify) { 83 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, PRE_LogInAndVerify) {
85 SkipToLoginScreen(); 84 SkipToLoginScreen();
86 LogInAndVerifyStartUpURLs(); 85 LogInAndVerifyStartUpURLs();
87 } 86 }
88 87
89 // Verify that the policies are honored on an existing user's login. 88 // Verify that the policies are honored on an existing user's login.
90 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, LogInAndVerify) { 89 IN_PROC_BROWSER_TEST_F(RestoreOnStartupTestChromeOS, LogInAndVerify) {
91 content::WindowedNotificationObserver( 90 content::WindowedNotificationObserver(
92 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, 91 chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
93 content::NotificationService::AllSources()).Wait(); 92 content::NotificationService::AllSources()).Wait();
94 LogInAndVerifyStartUpURLs(); 93 LogInAndVerifyStartUpURLs();
95 } 94 }
96 95
97 } // namespace policy 96 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698