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

Unified Diff: chrome/browser/chromeos/policy/status_uploader_unittest.cc

Issue 2338733002: Use TestSimpleTaskRunner::HasPendingTask instead of GetPendingTasks().empty() (Closed)
Patch Set: +bluetooth_adapter_win_unittest.cc Created 4 years, 3 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
Index: chrome/browser/chromeos/policy/status_uploader_unittest.cc
diff --git a/chrome/browser/chromeos/policy/status_uploader_unittest.cc b/chrome/browser/chromeos/policy/status_uploader_unittest.cc
index bc13d68b4c8b30bc89c28f6bd51519f5649dde50..39d55c657847f6723726ffbcb75e01a3529201a6 100644
--- a/chrome/browser/chromeos/policy/status_uploader_unittest.cc
+++ b/chrome/browser/chromeos/policy/status_uploader_unittest.cc
@@ -106,7 +106,7 @@ class StatusUploaderTest : public testing::Test {
base::TimeDelta expected_delay) {
// Running the task should pass two callbacks into GetDeviceStatusAsync
// and GetDeviceSessionStatusAsync. We'll grab these two callbacks.
- EXPECT_FALSE(task_runner_->GetPendingTasks().empty());
+ EXPECT_TRUE(task_runner_->HasPendingTask());
DeviceStatusCollector::DeviceStatusCallback ds_callback;
DeviceStatusCollector::DeviceSessionStatusCallback ss_callback;
EXPECT_CALL(*collector_ptr_, GetDeviceStatusAsync(_))
@@ -134,7 +134,7 @@ class StatusUploaderTest : public testing::Test {
// Make sure no status upload is queued up yet (since an upload is in
// progress).
- EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
+ EXPECT_FALSE(task_runner_->HasPendingTask());
// Now invoke the response.
callback.Run(true);
@@ -169,7 +169,7 @@ class StatusUploaderTest : public testing::Test {
};
TEST_F(StatusUploaderTest, BasicTest) {
- EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
+ EXPECT_FALSE(task_runner_->HasPendingTask());
StatusUploader uploader(&client_, std::move(collector_), task_runner_);
EXPECT_EQ(1U, task_runner_->NumPendingTasks());
// On startup, first update should happen in 1 minute.
@@ -182,7 +182,7 @@ TEST_F(StatusUploaderTest, DifferentFrequencyAtStart) {
settings_helper_.SetInteger(chromeos::kReportUploadFrequency, new_delay);
const base::TimeDelta expected_delay = base::TimeDelta::FromMilliseconds(
new_delay);
- EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
+ EXPECT_FALSE(task_runner_->HasPendingTask());
StatusUploader uploader(&client_, std::move(collector_), task_runner_);
ASSERT_EQ(1U, task_runner_->NumPendingTasks());
// On startup, first update should happen in 1 minute.

Powered by Google App Engine
This is Rietveld 408576698