Skip to content

Commit 34102ca

Browse files
authored
Migrate channels to pkg:integration _test (#120833)
* migrate to integration_test framework * Update embedding
1 parent cacef57 commit 34102ca

File tree

57 files changed

+858
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+858
-490
lines changed

dev/devicelab/lib/tasks/integration_tests.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import '../framework/task_result.dart';
88
import '../framework/utils.dart';
99

1010
TaskFunction createChannelsIntegrationTest() {
11-
return DriverTest(
11+
return IntegrationTest(
1212
'${flutterDirectory.path}/dev/integration_tests/channels',
13-
'lib/main.dart',
13+
'integration_test/main_test.dart',
1414
).call;
1515
}
1616

dev/integration_tests/channels/android/app/build.gradle

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
def localProperties = new Properties()
66
def localPropertiesFile = rootProject.file('local.properties')
77
if (localPropertiesFile.exists()) {
8-
localPropertiesFile.withInputStream { stream ->
9-
localProperties.load(stream)
8+
localPropertiesFile.withReader('UTF-8') { reader ->
9+
localProperties.load(reader)
1010
}
1111
}
1212

@@ -15,22 +15,38 @@ if (flutterRoot == null) {
1515
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
1616
}
1717

18+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
19+
if (flutterVersionCode == null) {
20+
flutterVersionCode = '1'
21+
}
22+
23+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
24+
if (flutterVersionName == null) {
25+
flutterVersionName = '1.0'
26+
}
27+
1828
apply plugin: 'com.android.application'
29+
apply plugin: 'kotlin-android'
1930
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2031

2132
android {
2233
compileSdkVersion flutter.compileSdkVersion
34+
ndkVersion flutter.ndkVersion
2335

2436
compileOptions {
2537
sourceCompatibility JavaVersion.VERSION_1_8
2638
targetCompatibility JavaVersion.VERSION_1_8
2739
}
2840

2941
defaultConfig {
42+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
43+
applicationId "com.example.channels"
44+
// You can update the following values to match your application needs.
45+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
3046
minSdkVersion flutter.minSdkVersion
3147
targetSdkVersion flutter.targetSdkVersion
32-
versionCode 1
33-
versionName "0.0.1"
48+
versionCode flutterVersionCode.toInteger()
49+
versionName flutterVersionName
3450
}
3551

3652
buildTypes {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Copyright 2014 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+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
6+
package="com.example.channels">
7+
<!-- The INTERNET permission is required for development. Specifically,
8+
the Flutter tool needs it to communicate with the running application
9+
to allow setting breakpoints, to provide hot reload, etc.
10+
-->
11+
<uses-permission android:name="android.permission.INTERNET"/>
12+
</manifest>

dev/integration_tests/channels/android/app/src/main/AndroidManifest.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@ Use of this source code is governed by a BSD-style license that can be
33
found in the LICENSE file. -->
44

55
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
6-
package="com.yourcompany.channels">
7-
8-
<!-- The INTERNET permission is required for development. Specifically,
9-
flutter needs it to communicate with the running application
10-
to allow setting breakpoints, to provide hot reload, etc.
11-
-->
12-
<uses-permission android:name="android.permission.INTERNET"/>
13-
14-
<!-- ${applicationName} is used by the Flutter tool to select the Application
15-
class to use. For most apps, this is the default Android application.
16-
In most cases you can leave this as-is, but you if you want to provide
17-
additional functionality it is fine to subclass or reimplement
18-
Application and put your custom class here. -->
19-
<application android:name="${applicationName}" android:label="channels" android:icon="@mipmap/ic_launcher">
20-
<activity android:name=".MainActivity"
21-
android:exported="true"
22-
android:launchMode="singleTop"
23-
android:theme="@android:style/Theme.Black.NoTitleBar"
24-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
25-
android:hardwareAccelerated="true"
26-
android:windowSoftInputMode="adjustResize">
6+
package="com.example.channels">
7+
<application
8+
android:label="channels"
9+
android:name="${applicationName}"
10+
android:icon="@mipmap/ic_launcher">
11+
<activity
12+
android:name=".MainActivity"
13+
android:exported="true"
14+
android:launchMode="singleTop"
15+
android:theme="@style/LaunchTheme"
16+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
17+
android:hardwareAccelerated="true"
18+
android:windowSoftInputMode="adjustResize">
19+
<!-- Specifies an Android theme to apply to this Activity as soon as
20+
the Android process has started. This theme is visible to the user
21+
while the Flutter UI initializes. After that, this theme continues
22+
to determine the Window background behind the Flutter UI. -->
23+
<meta-data
24+
android:name="io.flutter.embedding.android.NormalTheme"
25+
android:resource="@style/NormalTheme"
26+
/>
2727
<intent-filter>
2828
<action android:name="android.intent.action.MAIN"/>
2929
<category android:name="android.intent.category.LAUNCHER"/>
3030
</intent-filter>
3131
</activity>
32-
<!-- Don't delete the meta-data below.
33-
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
32+
<!-- Don't delete the meta-data below.
33+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
3434
<meta-data
3535
android:name="flutterEmbedding"
3636
android:value="2" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
package com.yourcompany.channels;
5+
package com.example.channels;
66

77
import java.io.ByteArrayOutputStream;
88
import java.nio.ByteBuffer;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
3+
Use of this source code is governed by a BSD-style license that can be
4+
found in the LICENSE file. -->
5+
6+
<!-- Modify this file to customize your launch splash screen -->
7+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
8+
<item android:drawable="?android:colorBackground" />
9+
10+
<!-- You can insert your own image assets here -->
11+
<!-- <item>
12+
<bitmap
13+
android:gravity="center"
14+
android:src="@mipmap/launch_image" />
15+
</item> -->
16+
</layer-list>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
3+
Use of this source code is governed by a BSD-style license that can be
4+
found in the LICENSE file. -->
5+
6+
<!-- Modify this file to customize your launch splash screen -->
7+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
8+
<item android:drawable="@android:color/white" />
9+
10+
<!-- You can insert your own image assets here -->
11+
<!-- <item>
12+
<bitmap
13+
android:gravity="center"
14+
android:src="@mipmap/launch_image" />
15+
</item> -->
16+
</layer-list>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
3+
Use of this source code is governed by a BSD-style license that can be
4+
found in the LICENSE file. -->
5+
6+
<resources>
7+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
8+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
9+
<!-- Show a splash screen on the activity. Automatically removed when
10+
the Flutter engine draws its first frame -->
11+
<item name="android:windowBackground">@drawable/launch_background</item>
12+
</style>
13+
<!-- Theme applied to the Android Window as soon as the process has started.
14+
This theme determines the color of the Android Window while your
15+
Flutter UI initializes, as well as behind your Flutter UI while its
16+
running.
17+
18+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
19+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
20+
<item name="android:windowBackground">?android:colorBackground</item>
21+
</style>
22+
</resources>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
3+
Use of this source code is governed by a BSD-style license that can be
4+
found in the LICENSE file. -->
5+
6+
<resources>
7+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
8+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
9+
<!-- Show a splash screen on the activity. Automatically removed when
10+
the Flutter engine draws its first frame -->
11+
<item name="android:windowBackground">@drawable/launch_background</item>
12+
</style>
13+
<!-- Theme applied to the Android Window as soon as the process has started.
14+
This theme determines the color of the Android Window while your
15+
Flutter UI initializes, as well as behind your Flutter UI while its
16+
running.
17+
18+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
19+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
20+
<item name="android:windowBackground">?android:colorBackground</item>
21+
</style>
22+
</resources>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Copyright 2014 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+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
6+
package="com.example.channels">
7+
<!-- The INTERNET permission is required for development. Specifically,
8+
the Flutter tool needs it to communicate with the running application
9+
to allow setting breakpoints, to provide hot reload, etc.
10+
-->
11+
<uses-permission android:name="android.permission.INTERNET"/>
12+
</manifest>

dev/integration_tests/channels/android/build.gradle

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,17 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// This file is auto generated.
6-
// To update all the build.gradle files in the Flutter repo,
7-
// See dev/tools/bin/generate_gradle_lockfiles.dart.
8-
95
buildscript {
10-
ext.kotlin_version = '1.5.31'
6+
ext.kotlin_version = '1.7.10'
117
repositories {
128
google()
139
mavenCentral()
1410
}
1511

1612
dependencies {
17-
classpath 'com.android.tools.build:gradle:7.2.0'
13+
classpath 'com.android.tools.build:gradle:7.3.0'
1814
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1915
}
20-
21-
configurations.classpath {
22-
resolutionStrategy.activateDependencyLocking()
23-
}
2416
}
2517

2618
allprojects {
@@ -31,19 +23,11 @@ allprojects {
3123
}
3224

3325
rootProject.buildDir = '../build'
34-
3526
subprojects {
3627
project.buildDir = "${rootProject.buildDir}/${project.name}"
3728
}
3829
subprojects {
3930
project.evaluationDependsOn(':app')
40-
dependencyLocking {
41-
ignoredDependencies.add('io.flutter:*')
42-
lockFile = file("${rootProject.projectDir}/project-${project.name}.lockfile")
43-
if (!project.hasProperty('local-engine-repo')) {
44-
lockAllConfigurations()
45-
}
46-
}
4731
}
4832

4933
task clean(type: Delete) {

0 commit comments

Comments
 (0)