Add Windows to the platform_channels example (#106754)
This commit is contained in:
@@ -544,6 +544,7 @@ Future<void> verifyNoMissingLicense(String workingDirectory, { bool checkMinimum
|
||||
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'java', overrideMinimumMatches ?? 39, _generateLicense('// '));
|
||||
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'h', overrideMinimumMatches ?? 30, _generateLicense('// '));
|
||||
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'm', overrideMinimumMatches ?? 30, _generateLicense('// '));
|
||||
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'cpp', overrideMinimumMatches ?? 0, _generateLicense('// '));
|
||||
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'swift', overrideMinimumMatches ?? 10, _generateLicense('// '));
|
||||
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'gradle', overrideMinimumMatches ?? 80, _generateLicense('// '));
|
||||
failed += await _verifyNoMissingLicenseForExtension(workingDirectory, 'gn', overrideMinimumMatches ?? 0, _generateLicense('# '));
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
await task(createPlatformChannelSampleTest(deviceIdOverride: 'windows'));
|
||||
}
|
||||
@@ -44,10 +44,11 @@ TaskFunction createExternalUiIntegrationTest() {
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createPlatformChannelSampleTest() {
|
||||
TaskFunction createPlatformChannelSampleTest({String? deviceIdOverride}) {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/examples/platform_channel',
|
||||
'test_driver/button_tap.dart',
|
||||
deviceIdOverride: deviceIdOverride,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -146,18 +147,25 @@ class DriverTest {
|
||||
this.testDirectory,
|
||||
this.testTarget, {
|
||||
this.extraOptions = const <String>[],
|
||||
this.deviceIdOverride,
|
||||
}
|
||||
);
|
||||
|
||||
final String testDirectory;
|
||||
final String testTarget;
|
||||
final List<String> extraOptions;
|
||||
final String? deviceIdOverride;
|
||||
|
||||
Future<TaskResult> call() {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
final String deviceId = device.deviceId;
|
||||
String deviceId;
|
||||
if (deviceIdOverride != null) {
|
||||
deviceId = deviceIdOverride!;
|
||||
} else {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
deviceId = device.deviceId;
|
||||
}
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
final List<String> options = <String>[
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "flutter_window.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <flutter/dart_project.h>
|
||||
#include <flutter/flutter_view_controller.h>
|
||||
#include <windows.h>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <flutter_windows.h>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "win32_window.h"
|
||||
|
||||
#include <flutter_windows.h>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <flutter_windows.h>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "win32_window.h"
|
||||
|
||||
#include <flutter_windows.h>
|
||||
|
||||
Reference in New Issue
Block a user