| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> |
| 5 #include <string> | 6 #include <string> |
| 6 #include <utility> | 7 #include <utility> |
| 7 | 8 |
| 8 #include "base/macros.h" | 9 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 13 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 14 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" | 14 #include "chrome/browser/chromeos/policy/login_policy_test_base.h" |
| 15 #include "chrome/browser/chromeos/policy/user_policy_test_helper.h" | 15 #include "chrome/browser/chromeos/policy/user_policy_test_helper.h" |
| 16 #include "chrome/browser/prefs/session_startup_pref.h" | 16 #include "chrome/browser/prefs/session_startup_pref.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_list.h" | 18 #include "chrome/browser/ui/browser_list.h" |
| 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 namespace policy { | 58 namespace policy { |
| 59 | 59 |
| 60 class UserCloudPolicyManagerTest : public LoginPolicyTestBase { | 60 class UserCloudPolicyManagerTest : public LoginPolicyTestBase { |
| 61 protected: | 61 protected: |
| 62 UserCloudPolicyManagerTest() {} | 62 UserCloudPolicyManagerTest() {} |
| 63 | 63 |
| 64 void GetMandatoryPoliciesValue(base::DictionaryValue* policy) const override { | 64 void GetMandatoryPoliciesValue(base::DictionaryValue* policy) const override { |
| 65 scoped_ptr<base::ListValue> list(new base::ListValue); | 65 std::unique_ptr<base::ListValue> list(new base::ListValue); |
| 66 list->AppendString("chrome://policy"); | 66 list->AppendString("chrome://policy"); |
| 67 list->AppendString("chrome://about"); | 67 list->AppendString("chrome://about"); |
| 68 | 68 |
| 69 policy->Set(key::kRestoreOnStartupURLs, std::move(list)); | 69 policy->Set(key::kRestoreOnStartupURLs, std::move(list)); |
| 70 policy->SetInteger(key::kRestoreOnStartup, | 70 policy->SetInteger(key::kRestoreOnStartup, |
| 71 SessionStartupPref::kPrefValueURLs); | 71 SessionStartupPref::kPrefValueURLs); |
| 72 } | 72 } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerTest); | 75 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerTest); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // User should not be marked as having a valid OAuth token. That way, if we | 120 // User should not be marked as having a valid OAuth token. That way, if we |
| 121 // try to load the user in the future, we will attempt to load policy again. | 121 // try to load the user in the future, we will attempt to load policy again. |
| 122 const user_manager::UserManager* user_manager = | 122 const user_manager::UserManager* user_manager = |
| 123 user_manager::UserManager::Get(); | 123 user_manager::UserManager::Get(); |
| 124 EXPECT_NE(user_manager::User::OAUTH2_TOKEN_STATUS_VALID, | 124 EXPECT_NE(user_manager::User::OAUTH2_TOKEN_STATUS_VALID, |
| 125 user_manager->GetActiveUser()->oauth_token_status()); | 125 user_manager->GetActiveUser()->oauth_token_status()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace policy | 128 } // namespace policy |
| OLD | NEW |