update_engine: Add locations to the MessageLoop calls.
When running the unittests with --v=1, this patch will show the location
where the tasks were posted to the FakeMessageLoop.
BUG=brillo:91
TEST=Ran unittest with --v=1
Change-Id: I0f9b0a3b67a40c26965a396258f1bd45e38f5ba3
Reviewed-on: https://chromium-review.googlesource.com/280568
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/update_manager/evaluation_context_unittest.cc b/update_manager/evaluation_context_unittest.cc
index 0ba9594..2b59026 100644
--- a/update_manager/evaluation_context_unittest.cc
+++ b/update_manager/evaluation_context_unittest.cc
@@ -323,14 +323,15 @@
// Test that timed events fired after removal of the EvaluationContext don't
// crash.
TEST_F(UmEvaluationContextTest, TimeoutEventAfterDeleteTest) {
- FakeVariable<string> fake_short_poll_var = {"fake_short_poll", TimeDelta()};
+ FakeVariable<string> fake_short_poll_var = {"fake_short_poll",
+ TimeDelta::FromSeconds(1)};
fake_short_poll_var.reset(new string("Polled value"));
eval_ctx_->GetValue(&fake_short_poll_var);
bool value = false;
EXPECT_TRUE(eval_ctx_->RunOnValueChangeOrTimeout(Bind(&SetTrue, &value)));
// Remove the last reference to the EvaluationContext and run the loop for
- // 1 second to give time to the main loop to trigger the timeout Event (of 0
- // seconds). Our callback should not be called because the EvaluationContext
+ // 10 seconds to give time to the main loop to trigger the timeout Event (of 1
+ // second). Our callback should not be called because the EvaluationContext
// was removed before the timeout event is attended.
eval_ctx_ = nullptr;
MessageLoopRunUntil(MessageLoop::current(),