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

Side by Side Diff: chrome/browser/policy/device_status_collector_unittest.cc

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | 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/policy/device_status_collector.h" 5 #include "chrome/browser/policy/device_status_collector.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 SetMockPositionToReturnNext(valid_fix); 519 SetMockPositionToReturnNext(valid_fix);
520 RestartStatusCollector(); 520 RestartStatusCollector();
521 CheckThatAValidLocationIsReported(); 521 CheckThatAValidLocationIsReported();
522 EXPECT_TRUE(mock_position_to_return_next.get()); 522 EXPECT_TRUE(mock_position_to_return_next.get());
523 523
524 // Check that after disabling location reporting again, the last known 524 // Check that after disabling location reporting again, the last known
525 // location has been cleared from local state and is no longer reported. 525 // location has been cleared from local state and is no longer reported.
526 SetMockPositionToReturnNext(valid_fix); 526 SetMockPositionToReturnNext(valid_fix);
527 cros_settings_->SetBoolean(chromeos::kReportDeviceLocation, false); 527 cros_settings_->SetBoolean(chromeos::kReportDeviceLocation, false);
528 // Allow the new pref to propagate to the status collector. 528 // Allow the new pref to propagate to the status collector.
529 message_loop_.RunAllPending(); 529 message_loop_.RunUntilIdle();
530 EXPECT_TRUE(prefs_.GetDictionary(prefs::kDeviceLocation)->empty()); 530 EXPECT_TRUE(prefs_.GetDictionary(prefs::kDeviceLocation)->empty());
531 CheckThatNoLocationIsReported(); 531 CheckThatNoLocationIsReported();
532 532
533 // Check that after enabling location reporting again, an error is reported 533 // Check that after enabling location reporting again, an error is reported
534 // if no valid fix is available. 534 // if no valid fix is available.
535 SetMockPositionToReturnNext(invalid_fix); 535 SetMockPositionToReturnNext(invalid_fix);
536 cros_settings_->SetBoolean(chromeos::kReportDeviceLocation, true); 536 cros_settings_->SetBoolean(chromeos::kReportDeviceLocation, true);
537 // Allow the new pref to propagate to the status collector. 537 // Allow the new pref to propagate to the status collector.
538 message_loop_.RunAllPending(); 538 message_loop_.RunUntilIdle();
539 CheckThatALocationErrorIsReported(); 539 CheckThatALocationErrorIsReported();
540 } 540 }
541 541
542 } // namespace policy 542 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_management_service_unittest.cc ('k') | chrome/browser/policy/device_token_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698