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

Side by Side Diff: chrome/browser/chromeos/policy/device_status_collector_browsertest.cc

Issue 14200028: Make CrosSettings and DeviceSettingsService non Lazy instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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) 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/policy/device_status_collector.h" 5 #include "chrome/browser/chromeos/policy/device_status_collector.h"
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return policy::DeviceStatusCollector::kIdlePollIntervalSeconds * 1000; 226 return policy::DeviceStatusCollector::kIdlePollIntervalSeconds * 1000;
227 } 227 }
228 228
229 MessageLoop message_loop_; 229 MessageLoop message_loop_;
230 content::TestBrowserThread ui_thread_; 230 content::TestBrowserThread ui_thread_;
231 content::TestBrowserThread file_thread_; 231 content::TestBrowserThread file_thread_;
232 content::TestBrowserThread io_thread_; 232 content::TestBrowserThread io_thread_;
233 233
234 TestingPrefServiceSimple prefs_; 234 TestingPrefServiceSimple prefs_;
235 chromeos::system::MockStatisticsProvider statistics_provider_; 235 chromeos::system::MockStatisticsProvider statistics_provider_;
236 scoped_ptr<TestingDeviceStatusCollector> status_collector_; 236 chromeos::ScopedTestCrosSettings test_cros_settings_;
237 em::DeviceStatusReportRequest status_;
238 chromeos::CrosSettings* cros_settings_; 237 chromeos::CrosSettings* cros_settings_;
239 chromeos::CrosSettingsProvider* device_settings_provider_; 238 chromeos::CrosSettingsProvider* device_settings_provider_;
240 chromeos::StubCrosSettingsProvider stub_settings_provider_; 239 chromeos::StubCrosSettingsProvider stub_settings_provider_;
240 em::DeviceStatusReportRequest status_;
241 scoped_ptr<TestingDeviceStatusCollector> status_collector_;
241 }; 242 };
242 243
243 TEST_F(DeviceStatusCollectorTest, AllIdle) { 244 TEST_F(DeviceStatusCollectorTest, AllIdle) {
244 IdleState test_states[] = { 245 IdleState test_states[] = {
245 IDLE_STATE_IDLE, 246 IDLE_STATE_IDLE,
246 IDLE_STATE_IDLE, 247 IDLE_STATE_IDLE,
247 IDLE_STATE_IDLE 248 IDLE_STATE_IDLE
248 }; 249 };
249 cros_settings_->SetBoolean(chromeos::kReportDeviceActivityTimes, true); 250 cros_settings_->SetBoolean(chromeos::kReportDeviceActivityTimes, true);
250 251
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 // Check that after enabling location reporting again, an error is reported 565 // Check that after enabling location reporting again, an error is reported
565 // if no valid fix is available. 566 // if no valid fix is available.
566 SetMockPositionToReturnNext(invalid_fix); 567 SetMockPositionToReturnNext(invalid_fix);
567 cros_settings_->SetBoolean(chromeos::kReportDeviceLocation, true); 568 cros_settings_->SetBoolean(chromeos::kReportDeviceLocation, true);
568 // Allow the new pref to propagate to the status collector. 569 // Allow the new pref to propagate to the status collector.
569 message_loop_.RunUntilIdle(); 570 message_loop_.RunUntilIdle();
570 CheckThatALocationErrorIsReported(); 571 CheckThatALocationErrorIsReported();
571 } 572 }
572 573
573 } // namespace policy 574 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698