Commit 561aa698 authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[Background Sync] Fix bug in BackgroundSyncScheduler.

BackgroundSyncScheduler code was returning an incorrect
delayed_processing_info for Periodic Background Sync.

This change fixes that.

Change-Id: Ic5aa4505de2613bea5cd676de8faeca76100eb8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1851424
Auto-Submit: Mugdha Lakhani <nator@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: default avatarRayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704564}
parent 9ba90177
......@@ -91,7 +91,7 @@ DelayedProcessingInfo& BackgroundSyncScheduler::GetDelayedProcessingInfo(
if (sync_type == blink::mojom::BackgroundSyncType::ONE_SHOT)
return delayed_processing_info_one_shot_;
else
return delayed_processing_info_one_shot_;
return delayed_processing_info_periodic_;
}
} // namespace content
......@@ -171,4 +171,16 @@ TEST_F(BackgroundSyncSchedulerTest, MultipleStoragePartitions) {
run_loop_2.Run();
}
TEST_F(BackgroundSyncSchedulerTest, ScheduleBothTypesOfSync) {
base::RunLoop run_loop_1, run_loop_2;
ScheduleDelayedProcessing(
GURL(kUrl_1), blink::mojom::BackgroundSyncType::ONE_SHOT,
base::TimeDelta::FromMilliseconds(1), run_loop_1.QuitClosure());
ScheduleDelayedProcessing(
GURL(kUrl_1), blink::mojom::BackgroundSyncType::PERIODIC,
base::TimeDelta::FromMilliseconds(1), run_loop_2.QuitClosure());
run_loop_1.Run();
run_loop_2.Run();
}
} // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment