Skip to content

Commit d31c202

Browse files
committed
2 parents ae0ebc1 + 9d90132 commit d31c202

Some content is hidden

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

56 files changed

+1794
-330
lines changed

bin/internal/engine.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c757fc74512fe9039a31e194906bf3700b4c1319
1+
5fcfb995bbce72b5f1ee807121f51a3c0280c8b4

bin/internal/update_dart_sdk.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ if (Test-Path $dartSdkPath) {
4040
}
4141
New-Item $dartSdkPath -force -type directory | Out-Null
4242
$dartSdkZip = "$cachePath\dart-sdk.zip"
43-
Import-Module BitsTransfer
44-
Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip
43+
# TODO(goderbauer): remove (slow and backwards-incompatible) appveyor work around
44+
if (Test-Path Env:\APPVEYOR) {
45+
curl $dartSdkUrl -OutFile $dartSdkZip
46+
} else {
47+
Import-Module BitsTransfer
48+
Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip
49+
}
4550

4651
Write-Host "Unzipping Dart SDK..."
4752
If (Get-Command 7z -errorAction SilentlyContinue) {
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Copyright (c) 2017 The Chromium 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+
import 'dart:async';
6+
import 'dart:convert';
7+
import 'dart:io';
8+
9+
import 'package:path/path.dart' as path;
10+
11+
import 'package:flutter_devicelab/framework/adb.dart';
12+
import 'package:flutter_devicelab/framework/framework.dart';
13+
import 'package:flutter_devicelab/framework/utils.dart';
14+
15+
void main() {
16+
task(() async {
17+
final Device device = await devices.workingDevice;
18+
await device.unlock();
19+
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
20+
await inDirectory(appDir, () async {
21+
final Completer<Null> ready = new Completer<Null>();
22+
bool ok;
23+
print('run: starting...');
24+
final Process run = await startProcess(
25+
path.join(flutterDirectory.path, 'bin', 'flutter'),
26+
<String>['run', '--verbose', '--observatory-port=8888', '-d', device.deviceId, 'lib/commands.dart'],
27+
);
28+
run.stdout
29+
.transform(UTF8.decoder)
30+
.transform(const LineSplitter())
31+
.listen((String line) {
32+
print('run:stdout: $line');
33+
if (line.contains(new RegExp(r'^\[\s+\] For a more detailed help message, press "h"\. To quit, press "q"\.'))) {
34+
print('run: ready!');
35+
ready.complete();
36+
ok ??= true;
37+
}
38+
});
39+
run.stderr
40+
.transform(UTF8.decoder)
41+
.transform(const LineSplitter())
42+
.listen((String line) {
43+
stderr.writeln('run:stderr: $line');
44+
});
45+
run.exitCode.then((int exitCode) { ok = false; });
46+
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
47+
if (!ok)
48+
throw 'Failed to run test app.';
49+
await drive('none');
50+
print('test: pressing "p" to enable debugPaintSize...');
51+
run.stdin.write('p');
52+
await drive('debug_paint');
53+
print('test: pressing "p" again...');
54+
run.stdin.write('p');
55+
await drive('none');
56+
print('test: pressing "P" to enable performance overlay...');
57+
run.stdin.write('P');
58+
await drive('performance_overlay');
59+
print('test: pressing "P" again...');
60+
run.stdin.write('P');
61+
await drive('none');
62+
run.stdin.write('q');
63+
final int result = await run.exitCode;
64+
if (result != 0)
65+
throw 'Received unexpected exit code $result from run process.';
66+
});
67+
return new TaskResult.success(null);
68+
});
69+
}
70+
71+
Future<Null> drive(String name) async {
72+
print('drive: running commands_$name check...');
73+
final Process drive = await startProcess(
74+
path.join(flutterDirectory.path, 'bin', 'flutter'),
75+
<String>['drive', '--use-existing-app', 'http://127.0.0.1:8888/', '--keep-app-running', '--driver', 'test_driver/commands_${name}_test.dart'],
76+
);
77+
drive.stdout
78+
.transform(UTF8.decoder)
79+
.transform(const LineSplitter())
80+
.listen((String line) {
81+
print('drive:stdout: $line');
82+
});
83+
drive.stderr
84+
.transform(UTF8.decoder)
85+
.transform(const LineSplitter())
86+
.listen((String line) {
87+
stderr.writeln('drive:stderr: $line');
88+
});
89+
final int result = await drive.exitCode;
90+
if (result != 0)
91+
throw 'Failed to drive test app (exit code $result).';
92+
print('drive: finished commands_$name check successfully.');
93+
}

dev/devicelab/lib/framework/framework.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ class _TaskRunner {
134134
// are catching errors coming from arbitrary (and untrustworthy) task
135135
// code. Our goal is to convert the failure into a readable message.
136136
// Propagating it further is not useful.
137-
completer.complete(new TaskResult.failure(message));
137+
if (!completer.isCompleted)
138+
completer.complete(new TaskResult.failure(message));
138139
});
139140
return completer.future;
140141
}

dev/devicelab/manifest.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ tasks:
114114
stage: devicelab
115115
required_agent_capabilities: ["has-android-device"]
116116

117+
commands_test:
118+
description: >
119+
Runs tests of flutter run commands.
120+
stage: devicelab
121+
required_agent_capabilities: ["has-android-device"]
122+
flaky: true
123+
117124
android_sample_catalog_generator:
118125
description: >
119126
Builds sample catalog markdown pages and Android screenshots
@@ -131,7 +138,6 @@ tasks:
131138
Verifies that `flutter drive --route` still works. No performance numbers.
132139
stage: devicelab
133140
required_agent_capabilities: ["linux/android"]
134-
flaky: true
135141

136142
flutter_gallery_instrumentation_test:
137143
description: >
@@ -140,7 +146,6 @@ tasks:
140146
test can run on off-the-shelf infrastructures, such as Firebase Test Lab.
141147
stage: devicelab
142148
required_agent_capabilities: ["linux/android"]
143-
flaky: true
144149

145150
# iOS on-device tests
146151

@@ -149,22 +154,19 @@ tasks:
149154
Checks that platform channels work on iOS.
150155
stage: devicelab_ios
151156
required_agent_capabilities: ["has-ios-device"]
152-
flaky: true
153157

154158
platform_channel_sample_test_ios:
155159
description: >
156160
Runs a driver test on the Platform Channel sample app on iOS.
157161
stage: devicelab_ios
158162
required_agent_capabilities: ["has-ios-device"]
159-
flaky: true
160163

161164
complex_layout_scroll_perf_ios__timeline_summary:
162165
description: >
163166
Measures the runtime performance of the Complex Layout sample app on
164167
iOS.
165168
stage: devicelab_ios
166169
required_agent_capabilities: ["has-ios-device"]
167-
flaky: true
168170

169171
# flutter_gallery_ios__start_up:
170172
# description: >
@@ -186,14 +188,12 @@ tasks:
186188
iOS.
187189
stage: devicelab_ios
188190
required_agent_capabilities: ["has-ios-device"]
189-
flaky: true
190191

191192
basic_material_app_ios__size:
192193
description: >
193194
Measures the IPA size of a basic material app.
194195
stage: devicelab_ios
195196
required_agent_capabilities: ["has-ios-device"]
196-
flaky: true
197197

198198
# microbenchmarks_ios:
199199
# description: >
@@ -215,14 +215,12 @@ tasks:
215215
Runs end-to-end Flutter tests on iOS.
216216
stage: devicelab_ios
217217
required_agent_capabilities: ["has-ios-device"]
218-
flaky: true
219218

220219
ios_sample_catalog_generator:
221220
description: >
222221
Builds sample catalog markdown pages and iOS screenshots
223222
stage: devicelab_ios
224223
required_agent_capabilities: ["has-ios-device"]
225-
flaky: true
226224

227225
# Tests running on Windows host
228226

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2017 The Chromium 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+
import 'package:flutter_driver/driver_extension.dart';
6+
7+
import 'package:flutter/material.dart';
8+
import 'package:flutter/rendering.dart';
9+
10+
String log = '';
11+
12+
void main() {
13+
enableFlutterDriverExtension(handler: (String message) async {
14+
log = 'log:';
15+
await WidgetsBinding.instance.reassembleApplication();
16+
return log;
17+
});
18+
runApp(new MaterialApp(home: const Test()));
19+
}
20+
21+
class Test extends SingleChildRenderObjectWidget {
22+
const Test({ Key key }) : super(key: key);
23+
24+
@override
25+
RenderTest createRenderObject(BuildContext context) {
26+
return new RenderTest();
27+
}
28+
}
29+
30+
class RenderTest extends RenderProxyBox {
31+
RenderTest({ RenderBox child }) : super(child);
32+
33+
@override
34+
void debugPaintSize(PaintingContext context, Offset offset) {
35+
super.debugPaintSize(context, offset);
36+
log += ' debugPaintSize';
37+
}
38+
39+
@override
40+
void paint(PaintingContext context, Offset offset) {
41+
log += ' paint';
42+
}
43+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2017 The Chromium 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+
import 'package:flutter_driver/flutter_driver.dart';
6+
import 'package:test/test.dart';
7+
8+
void main() {
9+
FlutterDriver driver;
10+
11+
setUpAll(() async {
12+
driver = await FlutterDriver.connect();
13+
});
14+
15+
tearDownAll(() async {
16+
driver?.close();
17+
});
18+
19+
test('check that we are painting in debugPaintSize mode', () async {
20+
expect(await driver.requestData('status'), 'log: paint debugPaintSize');
21+
});
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2017 The Chromium 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+
import 'package:flutter_driver/flutter_driver.dart';
6+
import 'package:test/test.dart';
7+
8+
void main() {
9+
FlutterDriver driver;
10+
11+
setUpAll(() async {
12+
driver = await FlutterDriver.connect();
13+
});
14+
15+
tearDownAll(() async {
16+
driver?.close();
17+
});
18+
19+
test('check that we are in normal mode', () async {
20+
expect(await driver.requestData('status'), 'log: paint');
21+
await driver.waitForAbsent(find.byType('PerformanceOverlay'), timeout: Duration.ZERO);
22+
});
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2017 The Chromium 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+
import 'package:flutter_driver/flutter_driver.dart';
6+
import 'package:test/test.dart';
7+
8+
void main() {
9+
FlutterDriver driver;
10+
11+
setUpAll(() async {
12+
driver = await FlutterDriver.connect();
13+
});
14+
15+
tearDownAll(() async {
16+
driver?.close();
17+
});
18+
19+
test('check that we are showing the performance overlay', () async {
20+
await driver.requestData('status'); // force a reassemble
21+
await driver.waitFor(find.byType('PerformanceOverlay'), timeout: Duration.ZERO);
22+
});
23+
}

dev/integration_tests/ui/test_driver/keyboard_resize_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2017 The Chromium 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+
15
import 'dart:async';
26

37
import 'package:integration_ui/keys.dart' as keys;

0 commit comments

Comments
 (0)