1 // Copyright 2018 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.base.task;
6 
7 import android.support.test.filters.SmallTest;
8 
9 import org.junit.Test;
10 import org.junit.runner.RunWith;
11 
12 import org.chromium.base.test.BaseJUnit4ClassRunner;
13 import org.chromium.base.test.task.SchedulerTestHelpers;
14 
15 /**
16  * Test class for {@link TaskRunner}.
17  *
18  * Note due to layering concerns we can't test post native functionality in a
19  * base javatest. Instead see:
20  * content/public/android/javatests/src/org/chromium/content/browser/scheduler/
21  * NativePostTaskTest.java
22  */
23 @RunWith(BaseJUnit4ClassRunner.class)
24 public class TaskRunnerImplTest {
25     @Test
26     @SmallTest
testPreNativePostTask()27     public void testPreNativePostTask() {
28         TaskRunner taskQueue = new TaskRunnerImpl(TaskTraits.USER_BLOCKING);
29 
30         // This should not time out.
31         SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
32     }
33 }
34