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

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

Issue 18308004: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 5 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 | Annotate | Revision Log
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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 owner_key_util_->SetPrivateKey(policy_.signing_key()); 165 owner_key_util_->SetPrivateKey(policy_.signing_key());
166 device_settings_test_helper_.set_policy_blob(policy_.GetBlob()); 166 device_settings_test_helper_.set_policy_blob(policy_.GetBlob());
167 LoadSettingsOperation op( 167 LoadSettingsOperation op(
168 base::Bind(&SessionManagerOperationTest::OnOperationCompleted, 168 base::Bind(&SessionManagerOperationTest::OnOperationCompleted,
169 base::Unretained(this))); 169 base::Unretained(this)));
170 170
171 EXPECT_CALL(*this, OnOperationCompleted(&op, _)).Times(0); 171 EXPECT_CALL(*this, OnOperationCompleted(&op, _)).Times(0);
172 op.Start(&device_settings_test_helper_, owner_key_util_, NULL); 172 op.Start(&device_settings_test_helper_, owner_key_util_, NULL);
173 device_settings_test_helper_.FlushLoops(); 173 device_settings_test_helper_.FlushLoops();
174 device_settings_test_helper_.FlushRetrieve(); 174 device_settings_test_helper_.FlushRetrieve();
175 EXPECT_TRUE(op.owner_key()); 175 EXPECT_TRUE(op.owner_key().get());
176 EXPECT_TRUE(op.owner_key()->public_key()); 176 EXPECT_TRUE(op.owner_key()->public_key());
177 Mock::VerifyAndClearExpectations(this); 177 Mock::VerifyAndClearExpectations(this);
178 178
179 // Now install a different key and policy and restart the operation. 179 // Now install a different key and policy and restart the operation.
180 policy_.set_signing_key(policy::PolicyBuilder::CreateTestNewSigningKey()); 180 policy_.set_signing_key(policy::PolicyBuilder::CreateTestNewSigningKey());
181 policy_.payload().mutable_metrics_enabled()->set_metrics_enabled(true); 181 policy_.payload().mutable_metrics_enabled()->set_metrics_enabled(true);
182 policy_.Build(); 182 policy_.Build();
183 device_settings_test_helper_.set_policy_blob(policy_.GetBlob()); 183 device_settings_test_helper_.set_policy_blob(policy_.GetBlob());
184 owner_key_util_->SetPrivateKey(policy_.signing_key()); 184 owner_key_util_->SetPrivateKey(policy_.signing_key());
185 185
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 EXPECT_FALSE(op.policy_data()->has_request_token()); 280 EXPECT_FALSE(op.policy_data()->has_request_token());
281 EXPECT_EQ(policy_.policy_data().username(), op.policy_data()->username()); 281 EXPECT_EQ(policy_.policy_data().username(), op.policy_data()->username());
282 282
283 // Loaded device settings should match what the operation received. 283 // Loaded device settings should match what the operation received.
284 ASSERT_TRUE(op.device_settings().get()); 284 ASSERT_TRUE(op.device_settings().get());
285 EXPECT_EQ(policy_.payload().SerializeAsString(), 285 EXPECT_EQ(policy_.payload().SerializeAsString(),
286 op.device_settings()->SerializeAsString()); 286 op.device_settings()->SerializeAsString());
287 } 287 }
288 288
289 } // namespace chromeos 289 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/session_manager_operation.cc ('k') | chrome/browser/chromeos/swap_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698