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

Unified Diff: cc/tiles/software_image_decode_controller_unittest.cc

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 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 | « cc/tiles/software_image_decode_controller.cc ('k') | cc/tiles/tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/software_image_decode_controller_unittest.cc
diff --git a/cc/tiles/software_image_decode_controller_unittest.cc b/cc/tiles/software_image_decode_controller_unittest.cc
index b38e9795002f4b6d3201bbb68078bb84a001f814..2a0695db43b225d779edee713745e482cdc2f7ec 100644
--- a/cc/tiles/software_image_decode_controller_unittest.cc
+++ b/cc/tiles/software_image_decode_controller_unittest.cc
@@ -637,9 +637,7 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyDecoded) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
+ // TODO(prashant.n): Implement proper task life cycle. crbug.com/599863.
task->RunOnWorkerThread();
scoped_refptr<TileTask> another_task;
@@ -648,9 +646,7 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyDecoded) {
EXPECT_TRUE(need_unref);
EXPECT_FALSE(another_task);
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
controller.UnrefImage(draw_image);
controller.UnrefImage(draw_image);
@@ -671,9 +667,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyPrerolled) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
task->RunOnWorkerThread();
scoped_refptr<TileTask> another_task;
@@ -682,9 +675,7 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyPrerolled) {
EXPECT_TRUE(need_unref);
EXPECT_FALSE(another_task);
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
scoped_refptr<TileTask> third_task;
need_unref = controller.GetTaskForImageAndRef(
@@ -712,10 +703,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageCanceledGetsNewTask) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
scoped_refptr<TileTask> another_task;
need_unref = controller.GetTaskForImageAndRef(
draw_image, ImageDecodeController::TracingInfo(), &another_task);
@@ -723,9 +710,7 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageCanceledGetsNewTask) {
EXPECT_TRUE(another_task.get() == task.get());
// Didn't run the task, complete it (it was canceled).
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
// Fully cancel everything (so the raster would unref things).
controller.UnrefImage(draw_image);
@@ -758,10 +743,6 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
scoped_refptr<TileTask> another_task;
need_unref = controller.GetTaskForImageAndRef(
draw_image, ImageDecodeController::TracingInfo(), &another_task);
@@ -769,9 +750,7 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(another_task.get() == task.get());
// Didn't run the task, complete it (it was canceled).
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
// Note that here, everything is reffed, but a new task is created. This is
// possible with repeated schedule/cancel operations.
@@ -803,15 +782,9 @@ TEST(SoftwareImageDecodeControllerTest, GetDecodedImageForDraw) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
DecodedDrawImage decoded_draw_image =
controller.GetDecodedImageForDraw(draw_image);
@@ -844,15 +817,9 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
DecodedDrawImage decoded_draw_image =
controller.GetDecodedImageForDraw(draw_image);
@@ -952,15 +919,9 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
DecodedDrawImage another_decoded_draw_image =
controller.GetDecodedImageForDraw(draw_image);
@@ -1005,19 +966,13 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
// If we finish the draw here, then we will use it for the locked decode
// instead of decoding again.
controller.DrawWithImageFinished(draw_image, decoded_draw_image);
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
- task->DidComplete();
+ task->OnTaskCompleted();
DecodedDrawImage another_decoded_draw_image =
controller.GetDecodedImageForDraw(draw_image);
« no previous file with comments | « cc/tiles/software_image_decode_controller.cc ('k') | cc/tiles/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698