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

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

Issue 60323006: Updated test expectations after http://crrev.com/233323. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/device_settings_service.h" 5 #include "chrome/browser/chromeos/settings/device_settings_service.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/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 TEST_F(DeviceSettingsServiceTest, LoadValidationErrorFutureTimestamp) { 114 TEST_F(DeviceSettingsServiceTest, LoadValidationErrorFutureTimestamp) {
115 base::Time timestamp(base::Time::NowFromSystemTime() + 115 base::Time timestamp(base::Time::NowFromSystemTime() +
116 base::TimeDelta::FromDays(5000)); 116 base::TimeDelta::FromDays(5000));
117 device_policy_.policy_data().set_timestamp( 117 device_policy_.policy_data().set_timestamp(
118 (timestamp - base::Time::UnixEpoch()).InMilliseconds()); 118 (timestamp - base::Time::UnixEpoch()).InMilliseconds());
119 device_policy_.Build(); 119 device_policy_.Build();
120 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); 120 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob());
121 owner_key_util_->SetPublicKeyFromPrivateKey(*device_policy_.GetSigningKey()); 121 owner_key_util_->SetPublicKeyFromPrivateKey(*device_policy_.GetSigningKey());
122 ReloadDeviceSettings(); 122 ReloadDeviceSettings();
123 123
124 EXPECT_EQ(DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR, 124 // Loading a cached device policy with a timestamp in the future should work,
125 // since this may be due to a broken clock on the client device.
126 EXPECT_EQ(DeviceSettingsService::STORE_SUCCESS,
125 device_settings_service_.status()); 127 device_settings_service_.status());
126 EXPECT_FALSE(device_settings_service_.policy_data()); 128 CheckPolicy();
127 EXPECT_FALSE(device_settings_service_.device_settings());
128 } 129 }
129 130
130 TEST_F(DeviceSettingsServiceTest, LoadSuccess) { 131 TEST_F(DeviceSettingsServiceTest, LoadSuccess) {
131 ReloadDeviceSettings(); 132 ReloadDeviceSettings();
132 133
133 EXPECT_EQ(DeviceSettingsService::STORE_SUCCESS, 134 EXPECT_EQ(DeviceSettingsService::STORE_SUCCESS,
134 device_settings_service_.status()); 135 device_settings_service_.status());
135 CheckPolicy(); 136 CheckPolicy();
136 } 137 }
137 138
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 EXPECT_CALL(observer_, OwnershipStatusChanged()).Times(0); 483 EXPECT_CALL(observer_, OwnershipStatusChanged()).Times(0);
483 EXPECT_CALL(observer_, DeviceSettingsUpdated()).Times(1); 484 EXPECT_CALL(observer_, DeviceSettingsUpdated()).Times(1);
484 device_settings_service_.PropertyChangeComplete(true); 485 device_settings_service_.PropertyChangeComplete(true);
485 FlushDeviceSettings(); 486 FlushDeviceSettings();
486 Mock::VerifyAndClearExpectations(&observer_); 487 Mock::VerifyAndClearExpectations(&observer_);
487 488
488 device_settings_service_.RemoveObserver(&observer_); 489 device_settings_service_.RemoveObserver(&observer_);
489 } 490 }
490 491
491 } // namespace chromeos 492 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698