Flutter Engine
The Flutter Engine
testing
scenario_app
android
app
src
androidTest
java
dev
flutter
scenariosui
ExternalTextureTests.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
5
package
dev.flutter.scenariosui;
6
7
import
android
.content.Intent;
8
import
androidx.annotation.NonNull;
9
import
androidx.test.ext.junit.runners.AndroidJUnit4;
10
import
androidx.test.filters.LargeTest;
11
import
androidx.test.rule.ActivityTestRule;
12
import
dev.flutter.scenarios.ExternalTextureFlutterActivity;
13
import
org.junit.Before;
14
import
org.junit.Rule;
15
import
org.junit.Test;
16
import
org.junit.runner.RunWith;
17
18
@RunWith(AndroidJUnit4.class)
19
@LargeTest
20
public
class
ExternalTextureTests
{
21
private
Intent intent;
22
23
@Rule @NonNull
24
public
ActivityTestRule<ExternalTextureFlutterActivity>
activityRule
=
25
new
ActivityTestRule<>(
26
ExternalTextureFlutterActivity
.class,
27
/*initialTouchMode=*/
false
,
28
/*launchActivity=*/
false
);
29
30
@Before
31
public
void
setUp
() {
32
intent =
new
Intent(Intent.ACTION_MAIN);
33
}
34
35
@Test
36
public
void
testCanvasSurface
() throws Exception {
37
intent.putExtra(
"scenario_name"
,
"display_texture"
);
38
intent.putExtra(
"surface_renderer"
,
"canvas"
);
39
ScreenshotUtil
.
capture
(
40
activityRule
.launchActivity(intent),
"ExternalTextureTests_testCanvasSurface"
);
41
}
42
43
@Test
44
public
void
testMediaSurface
() throws Exception {
45
intent.putExtra(
"scenario_name"
,
"display_texture"
);
46
intent.putExtra(
"surface_renderer"
,
"media"
);
47
ScreenshotUtil
.
capture
(
48
activityRule
.launchActivity(intent),
"ExternalTextureTests_testMediaSurface"
);
49
}
50
}
dev.flutter.scenarios.ExternalTextureFlutterActivity
Definition:
ExternalTextureFlutterActivity.java:45
dev.flutter.scenariosui.ExternalTextureTests
Definition:
ExternalTextureTests.java:20
dev.flutter.scenariosui.ExternalTextureTests.testCanvasSurface
void testCanvasSurface()
Definition:
ExternalTextureTests.java:36
dev.flutter.scenariosui.ExternalTextureTests.activityRule
ActivityTestRule< ExternalTextureFlutterActivity > activityRule
Definition:
ExternalTextureTests.java:24
dev.flutter.scenariosui.ExternalTextureTests.setUp
void setUp()
Definition:
ExternalTextureTests.java:31
dev.flutter.scenariosui.ExternalTextureTests.testMediaSurface
void testMediaSurface()
Definition:
ExternalTextureTests.java:44
dev.flutter.scenariosui.ScreenshotUtil
Definition:
ScreenshotUtil.java:22
dev.flutter.scenariosui.ScreenshotUtil.capture
static void capture(@NonNull TestableFlutterActivity activity, @NonNull String captureName)
Definition:
ScreenshotUtil.java:125
android
Definition:
BitmapRegionDecoder.cpp:14
Generated on Sun Jun 23 2024 21:55:19 for Flutter Engine by
1.9.4