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

Unified Diff: base/task_unittest.cc

Issue 7062042: 1;2305;0cRevert 86971 - Move media library AutoTaskRunner to base and rename ScopedTaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « base/task.cc ('k') | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_unittest.cc
===================================================================
--- base/task_unittest.cc (revision 86971)
+++ base/task_unittest.cc (working copy)
@@ -49,62 +49,4 @@
delete cancelable_task;
}
-class DoneTask : public Task {
- public:
- DoneTask(int* run_count, bool* was_deleted)
- : run_count_(run_count), was_deleted_(was_deleted) {
- }
- virtual ~DoneTask() {
- *was_deleted_ = true;
- }
-
- virtual void Run() {
- ++(*run_count_);
- }
-
- int* run_count_;
- bool* was_deleted_;
-};
-
-TEST(TaskTest, TestScopedTaskRunnerExitScope) {
- int run_count = 0;
- bool was_deleted = false;
- {
- base::ScopedTaskRunner runner(new DoneTask(&run_count, &was_deleted));
- EXPECT_EQ(0, run_count);
- }
- EXPECT_EQ(1, run_count);
- EXPECT_TRUE(was_deleted);
-}
-
-TEST(TaskTest, TestScopedTaskRunnerRelease) {
- int run_count = 0;
- bool was_deleted = false;
- {
- base::ScopedTaskRunner runner(new DoneTask(&run_count, &was_deleted));
- delete runner.Release();
- EXPECT_TRUE(was_deleted);
- }
- EXPECT_EQ(0, run_count);
-}
-
-TEST(TaskTest, TestScopedTaskRunnerManualRun) {
- int run_count = 0;
- Task* done_task = NULL;
- bool was_deleted = false;
- {
- base::ScopedTaskRunner runner(new DoneTask(&run_count, &was_deleted));
- done_task = runner.Release();
- EXPECT_TRUE(NULL != done_task);
- EXPECT_FALSE(was_deleted);
- EXPECT_EQ(0, run_count);
- done_task->Run();
- EXPECT_FALSE(was_deleted);
- EXPECT_EQ(1, run_count);
- }
- EXPECT_EQ(1, run_count);
- delete done_task;
- EXPECT_TRUE(was_deleted);
-}
-
} // namespace
« no previous file with comments | « base/task.cc ('k') | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698