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

Unified Diff: chrome/browser/chromeos/login/login_utils_browsertest.cc

Issue 7233006: Store/Retrieve CrOS user policy in session_manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/policy/browser_policy_connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/login_utils_browsertest.cc
diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc
index 4137ce46b4e2f44ae8f67dd8ad0ae12af785ff25..d5c8cdb79a7327764981aad86c145485152f9f08 100644
--- a/chrome/browser/chromeos/login/login_utils_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc
@@ -49,6 +49,7 @@ namespace em = enterprise_management;
using ::testing::DoAll;
using ::testing::Return;
+using ::testing::SaveArg;
using ::testing::SetArgPointee;
using ::testing::_;
using content::BrowserThread;
@@ -79,8 +80,12 @@ const char kDMPolicyRequest[] =
const char kDMToken[] = "1234";
-ACTION_P(MockSessionManagerClientPolicyCallback, policy) {
- arg0.Run(policy);
+ACTION_P(MockSessionManagerClientRetrievePolicyCallback, policy) {
+ arg0.Run(*policy);
+}
+
+ACTION_P(MockSessionManagerClientStorePolicyCallback, success) {
+ arg1.Run(success);
}
template<typename TESTBASE>
@@ -111,9 +116,6 @@ class LoginUtilsTestBase : public TESTBASE,
virtual void SetUp() OVERRIDE {
ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir());
- // BrowserPolicyConnector makes the UserPolicyCache read relative to this
- // path. Make sure it's in a clean state.
- PathService::Override(chrome::DIR_USER_DATA, scoped_temp_dir_.path());
CommandLine* command_line = CommandLine::ForCurrentProcess();
command_line->AppendSwitch(switches::kEnableDevicePolicy);
@@ -132,7 +134,15 @@ class LoginUtilsTestBase : public TESTBASE,
MockSessionManagerClient* session_managed_client =
mock_dbus_thread_manager_.mock_session_manager_client();
EXPECT_CALL(*session_managed_client, RetrieveDevicePolicy(_))
- .WillRepeatedly(MockSessionManagerClientPolicyCallback(""));
+ .WillRepeatedly(
+ MockSessionManagerClientRetrievePolicyCallback(&device_policy_));
+ EXPECT_CALL(*session_managed_client, RetrieveUserPolicy(_))
+ .WillRepeatedly(
+ MockSessionManagerClientRetrievePolicyCallback(&user_policy_));
+ EXPECT_CALL(*session_managed_client, StoreUserPolicy(_, _))
+ .WillRepeatedly(
+ DoAll(SaveArg<0>(&user_policy_),
+ MockSessionManagerClientStorePolicyCallback(true)));
mock_async_method_caller_ = new cryptohome::MockAsyncMethodCaller;
cryptohome::AsyncMethodCaller::InitializeForTesting(
@@ -364,6 +374,9 @@ class LoginUtilsTestBase : public TESTBASE,
private:
ScopedTempDir scoped_temp_dir_;
+ std::string device_policy_;
+ std::string user_policy_;
+
DISALLOW_COPY_AND_ASSIGN(LoginUtilsTestBase);
};
« no previous file with comments | « no previous file | chrome/browser/policy/browser_policy_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698