1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.components.background_task_scheduler.internal; 6 7 import org.chromium.components.background_task_scheduler.BackgroundTask; 8 import org.chromium.components.background_task_scheduler.BackgroundTaskFactory; 9 import org.chromium.components.background_task_scheduler.TaskIds; 10 11 /** 12 * Implementation of {@link BackgroundTaskFactory} for testing. 13 * The default {@link TestBackgroundTask} class is used. 14 */ 15 public class TestBackgroundTaskFactory implements BackgroundTaskFactory { 16 @Override getBackgroundTaskFromTaskId(int taskId)17 public BackgroundTask getBackgroundTaskFromTaskId(int taskId) { 18 if (taskId == TaskIds.TEST) { 19 return new TestBackgroundTask(); 20 } 21 return null; 22 } 23 } 24