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

Side by Side Diff: chrome/browser/chromeos/login/signed_settings_helper_unittest.cc

Issue 9961014: Add calls to store/retrieve user policy to SessionManagerClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment. Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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/login/signed_settings_helper.h" 5 #include "chrome/browser/chromeos/login/signed_settings_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/chromeos/cros/cros_library.h" 9 #include "chrome/browser/chromeos/cros/cros_library.h"
10 #include "chrome/browser/chromeos/cros_settings_names.h" 10 #include "chrome/browser/chromeos/cros_settings_names.h"
11 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 11 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 std::string data_serialized = fake_policy_data_.SerializeAsString(); 52 std::string data_serialized = fake_policy_data_.SerializeAsString();
53 std::string serialized_policy_; 53 std::string serialized_policy_;
54 fake_policy_ = BuildProto(data_serialized, 54 fake_policy_ = BuildProto(data_serialized,
55 std::string("false"), 55 std::string("false"),
56 &serialized_policy_); 56 &serialized_policy_);
57 57
58 MockSessionManagerClient* client = 58 MockSessionManagerClient* client =
59 mock_dbus_thread_manager_->mock_session_manager_client(); 59 mock_dbus_thread_manager_->mock_session_manager_client();
60 // Make sure the mocked out class calls back to notify success on store and 60 // Make sure the mocked out class calls back to notify success on store and
61 // retrieve ops. 61 // retrieve ops.
62 EXPECT_CALL(*client, StorePolicy(_, _)) 62 EXPECT_CALL(*client, StoreDevicePolicy(_, _))
63 .WillRepeatedly(Store(true)); 63 .WillRepeatedly(Store(true));
64 EXPECT_CALL(*client, RetrievePolicy(_)) 64 EXPECT_CALL(*client, RetrieveDevicePolicy(_))
65 .WillRepeatedly(Retrieve(serialized_policy_)); 65 .WillRepeatedly(Retrieve(serialized_policy_));
66 66
67 EXPECT_CALL(m_, StartSigningAttempt(_, A<OwnerManager::Delegate*>())) 67 EXPECT_CALL(m_, StartSigningAttempt(_, A<OwnerManager::Delegate*>()))
68 .WillRepeatedly(WithArg<1>( 68 .WillRepeatedly(WithArg<1>(
69 Invoke(&SignedSettingsHelperTest::OnKeyOpComplete))); 69 Invoke(&SignedSettingsHelperTest::OnKeyOpComplete)));
70 EXPECT_CALL(m_, StartVerifyAttempt(_, _, A<OwnerManager::Delegate*>())) 70 EXPECT_CALL(m_, StartVerifyAttempt(_, _, A<OwnerManager::Delegate*>()))
71 .WillRepeatedly(WithArg<2>( 71 .WillRepeatedly(WithArg<2>(
72 Invoke(&SignedSettingsHelperTest::OnKeyOpComplete))); 72 Invoke(&SignedSettingsHelperTest::OnKeyOpComplete)));
73 } 73 }
74 74
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 base::Unretained(&cb))); 200 base::Unretained(&cb)));
201 SignedSettingsHelper::Get()->StartRetrievePolicyOp( 201 SignedSettingsHelper::Get()->StartRetrievePolicyOp(
202 base::Bind(&MockSignedSettingsCallbacks::OnRetrievePolicyCompleted, 202 base::Bind(&MockSignedSettingsCallbacks::OnRetrievePolicyCompleted,
203 base::Unretained(&cb))); 203 base::Unretained(&cb)));
204 204
205 message_loop_.RunAllPending(); 205 message_loop_.RunAllPending();
206 ASSERT_EQ(0, pending_ops_); 206 ASSERT_EQ(0, pending_ops_);
207 } 207 }
208 208
209 } // namespace chromeos 209 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/signed_settings.cc ('k') | chrome/browser/chromeos/login/signed_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698