OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/webui/downloads_ui_browsertest.h" | 5 #include "chrome/browser/ui/webui/downloads_ui_browsertest.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/managed_mode/managed_user_service.h" |
| 9 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
8 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "content/public/test/test_utils.h" |
11 | 14 |
12 DownloadsUIBrowserTest::DownloadsUIBrowserTest() { | 15 DownloadsUIBrowserTest::DownloadsUIBrowserTest() { |
13 } | 16 } |
14 | 17 |
15 DownloadsUIBrowserTest::~DownloadsUIBrowserTest() { | 18 DownloadsUIBrowserTest::~DownloadsUIBrowserTest() { |
16 } | 19 } |
17 | 20 |
18 void DownloadsUIBrowserTest::SetDeleteAllowed(bool allowed) { | 21 void DownloadsUIBrowserTest::SetDeleteAllowed(bool allowed) { |
19 browser()->profile()->GetPrefs()-> | 22 browser()->profile()->GetPrefs()-> |
20 SetBoolean(prefs::kAllowDeletingBrowserHistory, allowed); | 23 SetBoolean(prefs::kAllowDeletingBrowserHistory, allowed); |
21 } | 24 } |
| 25 |
| 26 void DownloadsUIBrowserTest::ChangeProfileToSupervised() { |
| 27 ManagedUserServiceFactory::GetForProfile( |
| 28 browser()->profile())->InitForTesting(); |
| 29 content::RunAllPendingInMessageLoop(); |
| 30 } |
OLD | NEW |