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

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: wip - fixed few unit tests Created 4 years, 8 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
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 38246b38398a20307d639ee76bde98d8a204badd..6b1414cc449388a6aaea522e73e0602162db2e21 100644
--- a/cc/tiles/software_image_decode_controller_unittest.cc
+++ b/cc/tiles/software_image_decode_controller_unittest.cc
@@ -504,9 +504,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyDecoded) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
task->RunOnWorkerThread();
scoped_refptr<ImageDecodeTask> another_task;
@@ -515,8 +512,7 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyDecoded) {
EXPECT_TRUE(need_unref);
EXPECT_FALSE(another_task);
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
+ controller.CompleteTask(task.get());
task->DidComplete();
controller.UnrefImage(draw_image);
@@ -539,9 +535,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyPrerolled) {
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
task->RunOnWorkerThread();
scoped_refptr<ImageDecodeTask> another_task;
@@ -550,8 +543,7 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageAlreadyPrerolled) {
EXPECT_TRUE(need_unref);
EXPECT_FALSE(another_task);
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
+ controller.CompleteTask(task.get());
task->DidComplete();
scoped_refptr<ImageDecodeTask> third_task;
@@ -580,11 +572,6 @@ TEST(SoftwareImageDecodeControllerTest, GetTaskForImageCanceledGetsNewTask) {
controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id, &task);
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
-
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
scoped_refptr<ImageDecodeTask> another_task;
need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id,
&another_task);
@@ -592,8 +579,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);
+ controller.CompleteTask(task.get());
task->DidComplete();
// Fully cancel everything (so the raster would unref things).
@@ -628,10 +614,6 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
scoped_refptr<ImageDecodeTask> another_task;
need_unref = controller.GetTaskForImageAndRef(draw_image, prepare_tiles_id,
&another_task);
@@ -639,8 +621,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);
+ controller.CompleteTask(task.get());
task->DidComplete();
// Note that here, everything is reffed, but a new task is created. This is
@@ -674,14 +655,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);
+ controller.CompleteTask(task.get());
task->DidComplete();
DecodedDrawImage decoded_draw_image =
@@ -716,14 +692,9 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
+ controller.CompleteTask(task.get());
task->DidComplete();
DecodedDrawImage decoded_draw_image =
@@ -825,14 +796,9 @@ TEST(SoftwareImageDecodeControllerTest,
EXPECT_TRUE(need_unref);
EXPECT_TRUE(task);
- task->WillSchedule();
- task->ScheduleOnOriginThread(nullptr);
- task->DidSchedule();
-
task->RunOnWorkerThread();
- task->WillComplete();
- task->CompleteOnOriginThread(nullptr);
+ controller.CompleteTask(task.get());
task->DidComplete();
DecodedDrawImage another_decoded_draw_image =
@@ -879,18 +845,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);
+ controller.CompleteTask(task.get());
task->DidComplete();
DecodedDrawImage another_decoded_draw_image =

Powered by Google App Engine
This is Rietveld 408576698