Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
HandlerCompatTest.java
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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
5package io.flutter.util;
6
7import static io.flutter.Build.API_LEVELS;
8import static org.junit.Assert.assertTrue;
9
10import android.os.Handler;
11import android.os.Looper;
12import android.os.Message;
13import org.junit.Test;
14import org.junit.runner.RunWith;
15import org.robolectric.RobolectricTestRunner;
16import org.robolectric.annotation.Config;
17
18@RunWith(RobolectricTestRunner.class)
19public class HandlerCompatTest {
20 @Test
21 @Config(sdk = API_LEVELS.API_28)
22 public void createAsync_createsAnAsyncHandler() {
23 Handler handler = Handler.createAsync(Looper.getMainLooper());
24
25 Message message = Message.obtain();
26 handler.sendMessageAtTime(message, 0);
27
28 assertTrue(message.isAsynchronous());
29 }
30}
Win32Message message