| OLD | NEW |
| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 SessionManagerOperationTest() | 42 SessionManagerOperationTest() |
| 43 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 43 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
| 44 file_thread_(content::BrowserThread::FILE, &message_loop_), | 44 file_thread_(content::BrowserThread::FILE, &message_loop_), |
| 45 owner_key_util_(new ownership::MockOwnerKeyUtil()), | 45 owner_key_util_(new ownership::MockOwnerKeyUtil()), |
| 46 validated_(false) { | 46 validated_(false) { |
| 47 OwnerSettingsServiceChromeOSFactory::GetInstance() | 47 OwnerSettingsServiceChromeOSFactory::GetInstance() |
| 48 ->SetOwnerKeyUtilForTesting(owner_key_util_); | 48 ->SetOwnerKeyUtilForTesting(owner_key_util_); |
| 49 } | 49 } |
| 50 | 50 |
| 51 virtual void SetUp() OVERRIDE { | 51 virtual void SetUp() OVERRIDE { |
| 52 policy_.payload().mutable_pinned_apps()->add_app_id("fake-app"); | |
| 53 policy_.Build(); | 52 policy_.Build(); |
| 54 | 53 |
| 55 profile_.reset(new TestingProfile()); | 54 profile_.reset(new TestingProfile()); |
| 56 service_ = | 55 service_ = |
| 57 OwnerSettingsServiceChromeOSFactory::GetForProfile(profile_.get()); | 56 OwnerSettingsServiceChromeOSFactory::GetForProfile(profile_.get()); |
| 58 } | 57 } |
| 59 | 58 |
| 60 MOCK_METHOD2(OnOperationCompleted, | 59 MOCK_METHOD2(OnOperationCompleted, |
| 61 void(SessionManagerOperation*, DeviceSettingsService::Status)); | 60 void(SessionManagerOperation*, DeviceSettingsService::Status)); |
| 62 | 61 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 message_loop_.RunUntilIdle(); | 270 message_loop_.RunUntilIdle(); |
| 272 EXPECT_TRUE(validated_); | 271 EXPECT_TRUE(validated_); |
| 273 | 272 |
| 274 // Loaded device settings should match what the operation received. | 273 // Loaded device settings should match what the operation received. |
| 275 ASSERT_TRUE(op.device_settings().get()); | 274 ASSERT_TRUE(op.device_settings().get()); |
| 276 EXPECT_EQ(policy_.payload().SerializeAsString(), | 275 EXPECT_EQ(policy_.payload().SerializeAsString(), |
| 277 op.device_settings()->SerializeAsString()); | 276 op.device_settings()->SerializeAsString()); |
| 278 } | 277 } |
| 279 | 278 |
| 280 } // namespace chromeos | 279 } // namespace chromeos |
| OLD | NEW |