DescriptionAdding tracing and gtest pretty printing support to TestPendingTask.
These functions where invaluable when trying to debug and fix the
cc::OrderedTestRunner as they let me easily inspect the tasks without having to
fire up GDB. They should also be useful in development / testing of other task
runners.
Added a very simple test for ShouldRunBefore which shows this stuff working. If
that test fails, the output looks like the following;
-------------------------------------------------------------------------------
../../base/test/test_pending_task_unittest.cc:49: Failure
Value of: task_after.ShouldRunBefore(task_first)
Actual: false
Expected: true
TestPendingTask(
{"delay":2000,"nestability":"NESTABLE","post_time":0,
"posting_function":"Unknown@Unknown:-1","run_at":2000}
).ShouldRunBefore(TestPendingTask(
{"delay":1000,"nestability":"NESTABLE","post_time":0,
"posting_function":"Unknown@Unknown:-1","run_at":1000})
)
-------------------------------------------------------------------------------
BUG=380889
Committed: https://crrev.com/e120a88b850d51b1db67ea693652a8c855610fb6
Cr-Commit-Position: refs/heads/master@{#292370}
Patch Set 1 #
Total comments: 3
Patch Set 2 : Rebase onto master. #Patch Set 3 : s/::std/std #
Messages
Total messages: 12 (0 generated)
|