Chromium Code Reviews| Index: base/test/test_pending_task.h |
| diff --git a/base/test/test_pending_task.h b/base/test/test_pending_task.h |
| index 024e281a8d299ab357e668f61a889c48de6f4ee0..c04b8afa72ed4eba0d92a493b46eb1914f516794 100644 |
| --- a/base/test/test_pending_task.h |
| +++ b/base/test/test_pending_task.h |
| @@ -5,7 +5,10 @@ |
| #ifndef BASE_TEST_TEST_PENDING_TASK_H_ |
| #define BASE_TEST_TEST_PENDING_TASK_H_ |
| +#include <string> |
| + |
| #include "base/callback.h" |
| +#include "base/debug/trace_event_argument.h" |
| #include "base/location.h" |
| #include "base/time/time.h" |
| @@ -51,8 +54,19 @@ struct TestPendingTask { |
| TimeTicks post_time; |
| TimeDelta delay; |
| TestNestability nestability; |
| + |
| + // Functions for using test pending task with tracing, useful in unit |
| + // testing. |
| + void AsValueInto(base::debug::TracedValue* state) const; |
| + scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| + std::string ToString() const; |
| }; |
| +// gtest helpers which allow pretty printing of the tasks, very useful in unit |
| +// testing. |
| +::std::ostream& operator<<(::std::ostream& os, const TestPendingTask& task); |
| +void PrintTo(const TestPendingTask& task, ::std::ostream* os); |
|
awong
2014/08/26 00:33:19
This should be a method in TestPendingTask.
mithro-old
2014/08/26 01:34:54
gtest requires this method to be in the name space
awong
2014/08/27 20:51:21
Ah hah...I just went and read the gtest documentat
|
| + |
| } // namespace base |
| -#endif // BASE_TEST_TEST_TASK_RUNNER_H_ |
| +#endif // BASE_TEST_TEST_PENDING_TASK_H_ |