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

Side by Side Diff: chrome/browser/chromeos/settings/session_manager_operation_unittest.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iwyu fixes Created 4 years, 8 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 "chrome/browser/chromeos/settings/session_manager_operation.h" 5 #include "chrome/browser/chromeos/settings/session_manager_operation.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory>
9 #include <string> 10 #include <string>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/bind_helpers.h" 14 #include "base/bind_helpers.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/memory/scoped_ptr.h"
17 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 19 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
20 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" 20 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h"
21 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact ory.h" 21 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact ory.h"
22 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" 22 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
23 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" 23 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
24 #include "chrome/test/base/testing_profile.h" 24 #include "chrome/test/base/testing_profile.h"
25 #include "components/ownership/mock_owner_key_util.h" 25 #include "components/ownership/mock_owner_key_util.h"
26 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 26 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 content::TestBrowserThread ui_thread_; 89 content::TestBrowserThread ui_thread_;
90 content::TestBrowserThread file_thread_; 90 content::TestBrowserThread file_thread_;
91 91
92 policy::DevicePolicyBuilder policy_; 92 policy::DevicePolicyBuilder policy_;
93 DeviceSettingsTestHelper device_settings_test_helper_; 93 DeviceSettingsTestHelper device_settings_test_helper_;
94 scoped_refptr<ownership::MockOwnerKeyUtil> owner_key_util_; 94 scoped_refptr<ownership::MockOwnerKeyUtil> owner_key_util_;
95 95
96 user_manager::FakeUserManager* user_manager_; 96 user_manager::FakeUserManager* user_manager_;
97 ScopedUserManagerEnabler user_manager_enabler_; 97 ScopedUserManagerEnabler user_manager_enabler_;
98 98
99 scoped_ptr<TestingProfile> profile_; 99 std::unique_ptr<TestingProfile> profile_;
100 OwnerSettingsServiceChromeOS* service_; 100 OwnerSettingsServiceChromeOS* service_;
101 101
102 bool validated_; 102 bool validated_;
103 103
104 private: 104 private:
105 DISALLOW_COPY_AND_ASSIGN(SessionManagerOperationTest); 105 DISALLOW_COPY_AND_ASSIGN(SessionManagerOperationTest);
106 }; 106 };
107 107
108 TEST_F(SessionManagerOperationTest, LoadNoPolicyNoKey) { 108 TEST_F(SessionManagerOperationTest, LoadNoPolicyNoKey) {
109 LoadSettingsOperation op( 109 LoadSettingsOperation op(
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 policy_.GetBlob()); 220 policy_.GetBlob());
221 ASSERT_TRUE(op.policy_data().get()); 221 ASSERT_TRUE(op.policy_data().get());
222 EXPECT_EQ(policy_.policy_data().SerializeAsString(), 222 EXPECT_EQ(policy_.policy_data().SerializeAsString(),
223 op.policy_data()->SerializeAsString()); 223 op.policy_data()->SerializeAsString());
224 ASSERT_TRUE(op.device_settings().get()); 224 ASSERT_TRUE(op.device_settings().get());
225 EXPECT_EQ(policy_.payload().SerializeAsString(), 225 EXPECT_EQ(policy_.payload().SerializeAsString(),
226 op.device_settings()->SerializeAsString()); 226 op.device_settings()->SerializeAsString());
227 } 227 }
228 228
229 } // namespace chromeos 229 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698