[go: nahoru, domu]

blob: 2fd82e1f0e4726e26ad71536cf21040d171e77a7 [file] [log] [blame]
Jelle Fresenef978312020-05-05 19:08:28 +01001/*
2 * Copyright 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package androidx.ui.test
18
19import android.os.Bundle
20import android.os.Handler
21import android.os.Looper
22import androidx.activity.ComponentActivity
23import androidx.test.filters.LargeTest
24import androidx.ui.core.setContent
Filip Pavlisb3943e12020-07-22 14:39:42 +010025import androidx.ui.test.android.createAndroidComposeRule
Jelle Fresenef978312020-05-05 19:08:28 +010026import androidx.ui.test.util.BoundaryNode
27import org.junit.Rule
28import org.junit.Test
29
30@LargeTest
31class LateSetContentTest {
32 @get:Rule
Filip Pavlisb3943e12020-07-22 14:39:42 +010033 val composeTestRule = createAndroidComposeRule<Activity>()
Jelle Fresenef978312020-05-05 19:08:28 +010034
35 @Test
36 fun test() {
Filip Pavlis659ea722020-07-13 14:14:32 +010037 onNodeWithTag("Node").assertExists()
Jelle Fresenef978312020-05-05 19:08:28 +010038 }
39
40 class Activity : ComponentActivity() {
41 private val handler = Handler(Looper.getMainLooper())
42 override fun onCreate(savedInstanceState: Bundle?) {
43 super.onCreate(savedInstanceState)
44 handler.postDelayed({
45 setContent { BoundaryNode("Node") }
46 }, 500)
47 }
48 }
49}