Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6c6ae06

Browse files
Add Windows to the platform_channels example (#106754)
1 parent b38150f commit 6c6ae06

34 files changed

+1215
-4
lines changed

.ci.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,6 +3981,21 @@ targets:
39813981
- bin/**
39823982
- .ci.yaml
39833983

3984+
- name: Windows platform_channel_sample_test_windows
3985+
recipe: devicelab/devicelab_drone
3986+
presubmit: false
3987+
timeout: 60
3988+
properties:
3989+
dependencies: >-
3990+
[
3991+
{"dependency": "vs_build", "version": "version:vs2019"}
3992+
]
3993+
tags: >
3994+
["devicelab", "hostonly"]
3995+
task_name: platform_channel_sample_test_windows
3996+
scheduler: luci
3997+
bringup: true
3998+
39843999
- name: Windows plugin_dependencies_test
39854000
recipe: devicelab/devicelab_drone
39864001
timeout: 60

TESTOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
/dev/devicelab/bin/tasks/module_test.dart @zanderso @flutter/tool
200200
/dev/devicelab/bin/tasks/native_platform_view_ui_tests_ios.dart @hellohuanlin @flutter/ios
201201
/dev/devicelab/bin/tasks/native_ui_tests_macos.dart @cbracken @flutter/desktop
202+
/dev/devicelab/bin/tasks/platform_channel_sample_test_windows.dart @cbracken @flutter/desktop
202203
/dev/devicelab/bin/tasks/plugin_test.dart @stuartmorgan @flutter/plugin
203204
/dev/devicelab/bin/tasks/plugin_test_ios.dart @jmagman @flutter/ios
204205
/dev/devicelab/bin/tasks/technical_debt__cost.dart @HansMuller @flutter/framework

dev/bots/analyze.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ Future<void> verifyNoMissingLicense(String workingDirectory, { bool checkMinimum
544544
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'java', overrideMinimumMatches ?? 39, _generateLicense('// '));
545545
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'h', overrideMinimumMatches ?? 30, _generateLicense('// '));
546546
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'm', overrideMinimumMatches ?? 30, _generateLicense('// '));
547+
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'cpp', overrideMinimumMatches ?? 0, _generateLicense('// '));
547548
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'swift', overrideMinimumMatches ?? 10, _generateLicense('// '));
548549
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'gradle', overrideMinimumMatches ?? 80, _generateLicense('// '));
549550
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'gn', overrideMinimumMatches ?? 0, _generateLicense('# '));
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
import 'package:flutter_devicelab/framework/framework.dart';
6+
import 'package:flutter_devicelab/tasks/integration_tests.dart';
7+
8+
Future<void> main() async {
9+
await task(createPlatformChannelSampleTest(deviceIdOverride: 'windows'));
10+
}

dev/devicelab/lib/tasks/integration_tests.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ TaskFunction createExternalUiIntegrationTest() {
4444
);
4545
}
4646

47-
TaskFunction createPlatformChannelSampleTest() {
47+
TaskFunction createPlatformChannelSampleTest({String? deviceIdOverride}) {
4848
return DriverTest(
4949
'${flutterDirectory.path}/examples/platform_channel',
5050
'test_driver/button_tap.dart',
51+
deviceIdOverride: deviceIdOverride,
5152
);
5253
}
5354

@@ -146,18 +147,25 @@ class DriverTest {
146147
this.testDirectory,
147148
this.testTarget, {
148149
this.extraOptions = const <String>[],
150+
this.deviceIdOverride,
149151
}
150152
);
151153

152154
final String testDirectory;
153155
final String testTarget;
154156
final List<String> extraOptions;
157+
final String? deviceIdOverride;
155158

156159
Future<TaskResult> call() {
157160
return inDirectory<TaskResult>(testDirectory, () async {
158-
final Device device = await devices.workingDevice;
159-
await device.unlock();
160-
final String deviceId = device.deviceId;
161+
String deviceId;
162+
if (deviceIdOverride != null) {
163+
deviceId = deviceIdOverride!;
164+
} else {
165+
final Device device = await devices.workingDevice;
166+
await device.unlock();
167+
deviceId = device.deviceId;
168+
}
161169
await flutter('packages', options: <String>['get']);
162170

163171
final List<String> options = <String>[

dev/integration_tests/flutter_gallery/windows/runner/flutter_window.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
#include "flutter_window.h"
26

37
#include <optional>

dev/integration_tests/flutter_gallery/windows/runner/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
#include <flutter/dart_project.h>
26
#include <flutter/flutter_view_controller.h>
37
#include <windows.h>

dev/integration_tests/flutter_gallery/windows/runner/utils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
#include "utils.h"
26

37
#include <flutter_windows.h>

dev/integration_tests/flutter_gallery/windows/runner/win32_window.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
#include "win32_window.h"
26

37
#include <flutter_windows.h>

dev/manual_tests/windows/runner/utils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
#include "utils.h"
26

37
#include <flutter_windows.h>

0 commit comments

Comments
 (0)