Skip to content

Commit 17c5c4c

Browse files
authored
Revert "Remove unused flutter_driver_screenshot integration test (flutter#76425)" (flutter#76572)
This reverts commit ff8f471.
1 parent ff8f471 commit 17c5c4c

Some content is hidden

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

61 files changed

+1587
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 1f3ff5ca429e6309810a4b79bc2bbf5b7e4f1fdb
8+
channel: unknown
9+
10+
project_type: app
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Summary
2+
3+
This test contains an app with a main page and subpages.
4+
The main page contains a list of buttons; each button leads to a designated subpage when tapped on.
5+
Each subpage should display some simple UIs to the screenshot tested.
6+
7+
The flutter driver test runs the app and opens each page to take a screenshot.
8+
9+
Use `main_test.dart` to test against golden files stored on Flutter Gold.
10+
11+
Note that new binaries can't be checked in the Flutter repo, so use [Flutter Gold](https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter) instead.
12+
13+
# Add a new page to test
14+
15+
1. Create a new class that extends `Page` and implement the UI to be tested in the `build` method.
16+
2. The new class should set a static `title` and `key`
17+
3. Add an instance of the new class to the `_allPages` list in the `main.dart`
18+
4. Create a new test case similar to `"'A page with an image screenshot"` in `test_driver/main_test.dart` to run the screenshot test.
19+
20+
An example of a `Page` subclass can be found in `lib/image_page.dart`
21+
22+
# Environments
23+
24+
* Device Lab which runs the app on iPhone 6s.
25+
* LUCI which runs the app on a Fuchsia NUC device.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
def localProperties = new Properties()
6+
def localPropertiesFile = rootProject.file('local.properties')
7+
if (localPropertiesFile.exists()) {
8+
localPropertiesFile.withReader('UTF-8') { reader ->
9+
localProperties.load(reader)
10+
}
11+
}
12+
13+
def flutterRoot = localProperties.getProperty('flutter.sdk')
14+
if (flutterRoot == null) {
15+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
16+
}
17+
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+
28+
apply plugin: 'com.android.application'
29+
apply plugin: 'kotlin-android'
30+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
31+
32+
android {
33+
compileSdkVersion 30
34+
35+
sourceSets {
36+
main.java.srcDirs += 'src/main/kotlin'
37+
}
38+
39+
defaultConfig {
40+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41+
applicationId "com.example.screenshot_tests"
42+
minSdkVersion 16
43+
targetSdkVersion 30
44+
versionCode flutterVersionCode.toInteger()
45+
versionName flutterVersionName
46+
}
47+
48+
buildTypes {
49+
release {
50+
// TODO: Add your own signing config for the release build.
51+
// Signing with the debug keys for now, so `flutter run --release` works.
52+
signingConfig signingConfigs.debug
53+
}
54+
}
55+
}
56+
57+
flutter {
58+
source '../..'
59+
}
60+
61+
dependencies {
62+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.screenshot_tests">
7+
<!-- Flutter needs it to communicate with the running application
8+
to allow setting breakpoints, to provide hot reload, etc.
9+
-->
10+
<uses-permission android:name="android.permission.INTERNET"/>
11+
</manifest>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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.screenshot_tests">
7+
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
8+
calls FlutterMain.startInitialization(this); in its onCreate method.
9+
In most cases you can leave this as-is, but you if you want to provide
10+
additional functionality it is fine to subclass or reimplement
11+
FlutterApplication and put your custom class here. -->
12+
<application
13+
android:name="io.flutter.app.FlutterApplication"
14+
android:label="screenshot_tests"
15+
android:icon="@mipmap/ic_launcher">
16+
<activity
17+
android:name=".MainActivity"
18+
android:launchMode="singleTop"
19+
android:theme="@style/LaunchTheme"
20+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
21+
android:hardwareAccelerated="true"
22+
android:windowSoftInputMode="adjustResize">
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN"/>
25+
<category android:name="android.intent.category.LAUNCHER"/>
26+
</intent-filter>
27+
</activity>
28+
<!-- Don't delete the meta-data below.
29+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
30+
<meta-data
31+
android:name="flutterEmbedding"
32+
android:value="2" />
33+
</application>
34+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
package com.example.screenshot_tests
6+
7+
import androidx.annotation.NonNull;
8+
import io.flutter.embedding.android.FlutterActivity
9+
import io.flutter.embedding.engine.FlutterEngine
10+
import io.flutter.plugins.GeneratedPluginRegistrant
11+
12+
class MainActivity: FlutterActivity() {
13+
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
14+
GeneratedPluginRegistrant.registerWith(flutterEngine);
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<?xml version="1.0" encoding="utf-8"?>
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: 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+
<?xml version="1.0" encoding="utf-8"?>
6+
<resources>
7+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
8+
<!-- Show a splash screen on the activity. Automatically removed when
9+
Flutter draws its first frame -->
10+
<item name="android:windowBackground">@drawable/launch_background</item>
11+
</style>
12+
</resources>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.screenshot_tests">
7+
<!-- Flutter needs it to communicate with the running application
8+
to allow setting breakpoints, to provide hot reload, etc.
9+
-->
10+
<uses-permission android:name="android.permission.INTERNET"/>
11+
</manifest>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
buildscript {
6+
ext.kotlin_version = '1.3.50'
7+
repositories {
8+
google()
9+
jcenter()
10+
}
11+
12+
dependencies {
13+
classpath 'com.android.tools.build:gradle:4.1.0'
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15+
}
16+
}
17+
18+
allprojects {
19+
repositories {
20+
google()
21+
jcenter()
22+
}
23+
}
24+
25+
rootProject.buildDir = '../build'
26+
subprojects {
27+
project.buildDir = "${rootProject.buildDir}/${project.name}"
28+
}
29+
subprojects {
30+
project.evaluationDependsOn(':app')
31+
}
32+
33+
task clean(type: Delete) {
34+
delete rootProject.buildDir
35+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
org.gradle.jvmargs=-Xmx1536M
2+
android.useAndroidX=true
3+
android.enableJetifier=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Fri Jun 23 08:50:38 CEST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
include ':app'
6+
7+
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8+
def properties = new Properties()
9+
10+
assert localPropertiesFile.exists()
11+
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
13+
def flutterSdkPath = properties.getProperty("flutter.sdk")
14+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15+
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"program": {
3+
"data": "data/flutter_driver_screenshot_test"
4+
},
5+
"sandbox": {
6+
"services": [
7+
"fuchsia.cobalt.LoggerFactory",
8+
"fuchsia.fonts.Provider",
9+
"fuchsia.logger.LogSink",
10+
"fuchsia.modular.Clipboard",
11+
"fuchsia.modular.ContextWriter",
12+
"fuchsia.modular.DeviceMap",
13+
"fuchsia.modular.ModuleContext",
14+
"fuchsia.sys.Environment",
15+
"fuchsia.sys.Launcher",
16+
"fuchsia.testing.runner.TestRunner",
17+
"fuchsia.ui.input.ImeService",
18+
"fuchsia.ui.policy.Presenter",
19+
"fuchsia.ui.scenic.Scenic"
20+
]
21+
}
22+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.mode1v3
2+
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
5+
*.perspectivev3
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
29+
!default.mode1v3
30+
!default.mode2v3
31+
!default.pbxuser
32+
!default.perspectivev3
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>App</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>io.flutter.flutter.app</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>App</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>MinimumOSVersion</key>
24+
<string>8.0</string>
25+
</dict>
26+
</plist>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "Generated.xcconfig"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2+
#include "Generated.xcconfig"

0 commit comments

Comments
 (0)