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

Unified Diff: extensions/common/one_shot_event_unittest.cc

Issue 2331423002: Replace TestSimpleTaskRunner::GetPendingTasks with TakePendingTasks (Closed)
Patch Set: make a Location result base::Optional 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
« no previous file with comments | « device/bluetooth/test/bluetooth_test_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/one_shot_event_unittest.cc
diff --git a/extensions/common/one_shot_event_unittest.cc b/extensions/common/one_shot_event_unittest.cc
index db0bca9fc8846c62f84b6a6b2c85d21b15cffc95..736eae8df9e5b5ce79e263fc1a1e3097ef69fec2 100644
--- a/extensions/common/one_shot_event_unittest.cc
+++ b/extensions/common/one_shot_event_unittest.cc
@@ -33,8 +33,15 @@ TEST(OneShotEventTest, CallsQueue) {
EXPECT_EQ(0U, runner->NumPendingTasks());
event.Signal();
ASSERT_EQ(2U, runner->NumPendingTasks());
- EXPECT_NE(runner->GetPendingTasks()[0].location.line_number(),
- runner->GetPendingTasks()[1].location.line_number())
+
+ base::Optional<tracked_objects::Location> first_item_location =
+ runner->GetPendingTaskLocationAt(0);
danakj 2016/09/29 19:42:13 Proposal: Rewrite this test to TakePendingTasks in
tzik 2016/09/30 04:00:26 SG. Updated.
+ base::Optional<tracked_objects::Location> second_item_location =
+ runner->GetPendingTaskLocationAt(1);
+ ASSERT_TRUE(first_item_location);
+ ASSERT_TRUE(second_item_location);
+ EXPECT_NE(first_item_location->line_number(),
+ second_item_location->line_number())
<< "Make sure FROM_HERE is propagated.";
EXPECT_EQ(0, i);
runner->RunPendingTasks();
« no previous file with comments | « device/bluetooth/test/bluetooth_test_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698