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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 1637943003: Remove HostDesktopType from BrowserList::GetInstance() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen-wrapper-land
Patch Set: 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 (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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 NULL); 2297 NULL);
2298 UpdateProviderPolicy(policies); 2298 UpdateProviderPolicy(policies);
2299 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME)); 2299 EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_HOME));
2300 content::WaitForLoadStop(contents); 2300 content::WaitForLoadStop(contents);
2301 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), contents->GetURL()); 2301 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), contents->GetURL());
2302 } 2302 }
2303 2303
2304 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) { 2304 IN_PROC_BROWSER_TEST_F(PolicyTest, IncognitoEnabled) {
2305 // Verifies that incognito windows can't be opened when disabled by policy. 2305 // Verifies that incognito windows can't be opened when disabled by policy.
2306 2306
2307 const BrowserList* active_browser_list = 2307 const BrowserList* active_browser_list = BrowserList::GetInstance();
2308 BrowserList::GetInstance(chrome::GetActiveDesktop());
2309 2308
2310 // Disable incognito via policy and verify that incognito windows can't be 2309 // Disable incognito via policy and verify that incognito windows can't be
2311 // opened. 2310 // opened.
2312 EXPECT_EQ(1u, active_browser_list->size()); 2311 EXPECT_EQ(1u, active_browser_list->size());
2313 EXPECT_FALSE(BrowserList::IsOffTheRecordSessionActive()); 2312 EXPECT_FALSE(BrowserList::IsOffTheRecordSessionActive());
2314 PolicyMap policies; 2313 PolicyMap policies;
2315 policies.Set(key::kIncognitoEnabled, 2314 policies.Set(key::kIncognitoEnabled,
2316 POLICY_LEVEL_MANDATORY, 2315 POLICY_LEVEL_MANDATORY,
2317 POLICY_SCOPE_USER, 2316 POLICY_SCOPE_USER,
2318 POLICY_SOURCE_CLOUD, 2317 POLICY_SOURCE_CLOUD,
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
3939 POLICY_SCOPE_USER, 3938 POLICY_SCOPE_USER,
3940 POLICY_SOURCE_CLOUD, 3939 POLICY_SOURCE_CLOUD,
3941 new base::FundamentalValue(false), 3940 new base::FundamentalValue(false),
3942 NULL); 3941 NULL);
3943 UpdateProviderPolicy(policies); 3942 UpdateProviderPolicy(policies);
3944 EXPECT_FALSE(display_manager->unified_desktop_enabled()); 3943 EXPECT_FALSE(display_manager->unified_desktop_enabled());
3945 } 3944 }
3946 #endif // defined(OS_CHROMEOS) 3945 #endif // defined(OS_CHROMEOS)
3947 3946
3948 } // namespace policy 3947 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698