forked from firka/flutter
[web] remove dependency on web_installers and transitively all code that used it (flutter/engine#32852)
This commit is contained in:
@@ -108,27 +108,6 @@ Changing parameters in the browser lock is effective immediately when running
|
||||
tests locally. To make changes effective on LUCI follow instructions in
|
||||
[Rolling Browsers][#rolling-browsers].
|
||||
|
||||
#### Local testing in Safari using the iOS Simulator
|
||||
|
||||
1. If you haven't already, install Xcode.
|
||||
2. The iOS version and device type used by web engine tests are specified in
|
||||
the [browser_lock.yaml][2] file. Install the iOS Simulator version using:
|
||||
Xcode > Preferences > Components
|
||||
3. Run `xcrun simctl list devices`. If the simulator you want is not installed
|
||||
use step 4.
|
||||
4. Use felt to create a simulator:
|
||||
|
||||
```
|
||||
felt create_simulator
|
||||
```
|
||||
|
||||
To run tests on ios-safari use the one of the following commands:
|
||||
|
||||
```
|
||||
felt test --browser=ios-safari
|
||||
felt test --browser=ios-safari test/alarm_clock_test.dart
|
||||
```
|
||||
|
||||
### Rolling browsers
|
||||
|
||||
When running tests on LUCI using Chromium, LUCI uses the version of Chromium
|
||||
|
||||
@@ -27,13 +27,11 @@ class BrowserLock {
|
||||
BrowserLock._fromYaml(YamlMap yaml) :
|
||||
chromeLock = ChromeLock._fromYaml(yaml['chrome'] as YamlMap),
|
||||
firefoxLock = FirefoxLock._fromYaml(yaml['firefox'] as YamlMap),
|
||||
edgeLock = EdgeLock._fromYaml(yaml['edge'] as YamlMap),
|
||||
safariIosLock = SafariIosLock._fromYaml(yaml['safari_ios'] as YamlMap);
|
||||
edgeLock = EdgeLock._fromYaml(yaml['edge'] as YamlMap);
|
||||
|
||||
final ChromeLock chromeLock;
|
||||
final FirefoxLock firefoxLock;
|
||||
final EdgeLock edgeLock;
|
||||
final SafariIosLock safariIosLock;
|
||||
}
|
||||
|
||||
class ChromeLock {
|
||||
@@ -68,22 +66,3 @@ class EdgeLock {
|
||||
|
||||
final String launcherVersion;
|
||||
}
|
||||
|
||||
class SafariIosLock {
|
||||
SafariIosLock._fromYaml(YamlMap yaml) :
|
||||
majorVersion = yaml['major_version'] as int,
|
||||
minorVersion = yaml['minor_version'] as int,
|
||||
device = yaml['device'] as String,
|
||||
heightOfHeader = yaml['height_of_header'] as int,
|
||||
heightOfFooter = yaml['height_of_footer'] as int,
|
||||
scaleFactor = yaml['scale_factor'] as double;
|
||||
|
||||
final int majorVersion;
|
||||
final int minorVersion;
|
||||
final String device;
|
||||
final int heightOfHeader;
|
||||
final int heightOfFooter;
|
||||
final double scaleFactor;
|
||||
|
||||
String get simulatorDescription => '$device with iOS $majorVersion.$minorVersion';
|
||||
}
|
||||
|
||||
@@ -25,30 +25,3 @@ firefox:
|
||||
|
||||
edge:
|
||||
launcher_version: '1.2.0.0'
|
||||
|
||||
safari_ios:
|
||||
# Make sure this version is the same version supported by LUCI macOS bots.
|
||||
# XCode on these bots will be updated once a year, do not forget to update
|
||||
# `heightOfHeader` during this time.
|
||||
major_version: 13
|
||||
minor_version: 0
|
||||
device: 'iPhone 11'
|
||||
# `xcrun simctl` command is used to take screenshots. It takes the screenshot
|
||||
# of the entire simulator. Therefore we need to crop all the parts other than
|
||||
# the browsers' content. This file must be in sync with the local and LUCI
|
||||
# versions of macOS, iOS Simulator, and Xcode.
|
||||
# `heightOfHeader` is the number of pixels taken by the phone's header menu
|
||||
# and the browsers address bar.
|
||||
# TODO: https://github.com/flutter/flutter/issues/65672
|
||||
height_of_header: 189
|
||||
# `heightOfFooter` is the number of pixels taken by the phone's navigation
|
||||
# menu.
|
||||
height_of_footer: 250
|
||||
# Most of the time tests use a portion of the screen to compare goldens
|
||||
# instead of the entire screen. This area is reprented by a rectangle
|
||||
# when taking screenshots. However the rectangle dimensions are in logical
|
||||
# coordinates. In order to convert these coordinates to coordinates on the
|
||||
# phone screeen we enlarge or shrink the area by applying a linear
|
||||
# transformation by a scale_factor (a.k.a. we perform isotropic scaling).
|
||||
# This value will be differ depending on the phone.
|
||||
scale_factor: 3.00
|
||||
|
||||
@@ -196,7 +196,8 @@ class ChromeInstaller {
|
||||
|
||||
stopwatch.stop();
|
||||
print(
|
||||
'INFO: The unzip took ${stopwatch.elapsedMilliseconds ~/ 1000} seconds.');
|
||||
'The unzip took ${stopwatch.elapsedMilliseconds ~/ 1000} seconds.'
|
||||
);
|
||||
} else {
|
||||
// We have to unzip into a temporary directory and then copy the files
|
||||
// out because our tests expect the files to be direct children of the
|
||||
|
||||
@@ -11,7 +11,6 @@ import 'browser_lock.dart';
|
||||
import 'chrome.dart';
|
||||
import 'edge.dart';
|
||||
import 'firefox.dart';
|
||||
import 'safari_ios.dart';
|
||||
import 'safari_macos.dart';
|
||||
|
||||
/// The port number for debugging.
|
||||
@@ -231,14 +230,12 @@ const String kChrome = 'chrome';
|
||||
const String kEdge = 'edge';
|
||||
const String kFirefox = 'firefox';
|
||||
const String kSafari = 'safari';
|
||||
const String kSafariIos = 'ios-safari';
|
||||
|
||||
const List<String> kAllBrowserNames = <String>[
|
||||
kChrome,
|
||||
kEdge,
|
||||
kFirefox,
|
||||
kSafari,
|
||||
kSafariIos,
|
||||
];
|
||||
|
||||
/// Creates an environment for a browser.
|
||||
@@ -254,8 +251,6 @@ BrowserEnvironment getBrowserEnvironment(String browserName) {
|
||||
return FirefoxEnvironment();
|
||||
case kSafari:
|
||||
return SafariMacOsEnvironment();
|
||||
case kSafariIos:
|
||||
return SafariIosEnvironment();
|
||||
}
|
||||
throw UnsupportedError('Browser $browserName is not supported.');
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
// Copyright 2013 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 'dart:async';
|
||||
|
||||
import 'package:args/command_runner.dart';
|
||||
import 'package:simulators/simulator_manager.dart';
|
||||
|
||||
import 'browser_lock.dart';
|
||||
import 'utils.dart';
|
||||
|
||||
class CreateSimulatorCommand extends Command<bool> with ArgUtils<bool> {
|
||||
@override
|
||||
String get name => 'create_simulator';
|
||||
|
||||
@override
|
||||
String get description => 'Creates mobile simulators.';
|
||||
|
||||
@override
|
||||
FutureOr<bool> run() async {
|
||||
final IosSimulatorManager iosSimulatorManager = IosSimulatorManager();
|
||||
try {
|
||||
final SafariIosLock lock = browserLock.safariIosLock;
|
||||
final IosSimulator simulator = await iosSimulatorManager.createSimulator(
|
||||
lock.majorVersion,
|
||||
lock.minorVersion,
|
||||
lock.device,
|
||||
);
|
||||
print('INFO: Simulator created $simulator');
|
||||
} catch (e) {
|
||||
throw Exception('Error creating requested simulator. You can use Xcode '
|
||||
'to install more versions: XCode > Preferences > Components.'
|
||||
' Exception: $e');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -169,13 +169,6 @@ class Environment {
|
||||
'test_results',
|
||||
));
|
||||
|
||||
/// Path to the screenshots taken by iOS simulator.
|
||||
io.Directory get webUiSimulatorScreenshotsDirectory =>
|
||||
io.Directory(pathlib.join(
|
||||
webUiDartToolDir.path,
|
||||
'ios_screenshots',
|
||||
));
|
||||
|
||||
/// Path to the script that clones the Flutter repo.
|
||||
io.File get cloneFlutterScript => io.File(pathlib.join(
|
||||
engineToolsDir.path,
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:args/command_runner.dart';
|
||||
|
||||
import 'build.dart';
|
||||
import 'clean.dart';
|
||||
import 'create_simulator.dart';
|
||||
import 'exceptions.dart';
|
||||
import 'licenses.dart';
|
||||
import 'run.dart';
|
||||
@@ -21,7 +20,6 @@ CommandRunner<bool> runner = CommandRunner<bool>(
|
||||
)
|
||||
..addCommand(BuildCommand())
|
||||
..addCommand(CleanCommand())
|
||||
..addCommand(CreateSimulatorCommand())
|
||||
..addCommand(LicensesCommand())
|
||||
..addCommand(RunCommand())
|
||||
..addCommand(TestCommand());
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
// Copyright 2013 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 'dart:async';
|
||||
import 'dart:io' as io;
|
||||
|
||||
import 'package:simulators/simulator_manager.dart';
|
||||
|
||||
import 'browser_lock.dart';
|
||||
import 'common.dart';
|
||||
import 'utils.dart';
|
||||
|
||||
/// Returns [IosSimulator] if the [Platform] is `macOS` and simulator
|
||||
/// is started.
|
||||
///
|
||||
/// Throws an [StateError] if these two conditions are not met.
|
||||
IosSimulator get iosSimulator {
|
||||
if (!io.Platform.isMacOS) {
|
||||
throw StateError('iOS Simulator is only available on macOS machines.');
|
||||
}
|
||||
if (_iosSimulator == null) {
|
||||
throw StateError(
|
||||
'iOS Simulator not started. Please first call initIOSSimulator method',
|
||||
);
|
||||
}
|
||||
return _iosSimulator!;
|
||||
}
|
||||
IosSimulator? _iosSimulator;
|
||||
|
||||
/// Inializes and boots an [IosSimulator] using the [iosMajorVersion],
|
||||
/// [iosMinorVersion] and [iosDevice] arguments.
|
||||
Future<void> initIosSimulator() async {
|
||||
if (_iosSimulator != null) {
|
||||
throw StateError('_iosSimulator can only be initialized once');
|
||||
}
|
||||
final IosSimulatorManager iosSimulatorManager = IosSimulatorManager();
|
||||
final IosSimulator simulator;
|
||||
final SafariIosLock lock = browserLock.safariIosLock;
|
||||
try {
|
||||
simulator = await iosSimulatorManager.getSimulator(
|
||||
lock.majorVersion,
|
||||
lock.minorVersion,
|
||||
lock.device,
|
||||
);
|
||||
_iosSimulator = simulator;
|
||||
} catch (e) {
|
||||
io.stderr.writeln(
|
||||
'Error getting iOS Simulator for ${lock.simulatorDescription}.\n'
|
||||
'Try running `felt create` command before running tests.',
|
||||
);
|
||||
rethrow;
|
||||
}
|
||||
|
||||
if (!simulator.booted) {
|
||||
await simulator.boot();
|
||||
print('INFO: Simulator ${simulator.id} booted.');
|
||||
cleanupCallbacks.add(() async {
|
||||
await simulator.shutdown();
|
||||
print('INFO: Simulator ${simulator.id} shutdown.');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the installation of Safari.
|
||||
///
|
||||
/// Currently uses the Safari version installed on the operating system.
|
||||
///
|
||||
/// Latest Safari version for Catalina, Mojave, High Siera is 13.
|
||||
///
|
||||
/// Latest Safari version for Sierra is 12.
|
||||
Future<BrowserInstallation> getOrInstallSafari({
|
||||
StringSink? infoLog,
|
||||
}) async {
|
||||
// These tests are aimed to run only on macOS machines local or on LUCI.
|
||||
if (!io.Platform.isMacOS) {
|
||||
throw UnimplementedError('Safari on ${io.Platform.operatingSystem} is'
|
||||
' not supported. Safari is only supported on macOS.');
|
||||
}
|
||||
|
||||
infoLog ??= io.stdout;
|
||||
|
||||
// Since Safari is included in macOS, always assume there will be one on the
|
||||
// system.
|
||||
infoLog.writeln('Using the system version that is already installed.');
|
||||
return BrowserInstallation(
|
||||
version: 'system',
|
||||
executable: PlatformBinding.instance.getMacApplicationLauncher(),
|
||||
);
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
// Copyright 2013 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 'dart:async';
|
||||
import 'dart:io' as io;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:image/image.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test_api/src/backend/runtime.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import 'browser.dart';
|
||||
import 'browser_lock.dart';
|
||||
import 'browser_process.dart';
|
||||
import 'environment.dart';
|
||||
import 'safari_installation.dart';
|
||||
import 'utils.dart';
|
||||
|
||||
/// Info about the screen layout for the current version of iOS Safari.
|
||||
///
|
||||
/// This is used to properly take screenshots of the browser.
|
||||
class SafariScreenInfo {
|
||||
SafariScreenInfo(this.heightOfHeader, this.heightOfFooter, this.scaleFactor);
|
||||
|
||||
final int heightOfHeader;
|
||||
final int heightOfFooter;
|
||||
final double scaleFactor;
|
||||
}
|
||||
|
||||
/// Provides an environment for the mobile variant of Safari running in an iOS
|
||||
/// simulator.
|
||||
class SafariIosEnvironment implements BrowserEnvironment {
|
||||
late final SafariScreenInfo _screenInfo;
|
||||
|
||||
@override
|
||||
final String name = 'Safari iOS';
|
||||
|
||||
@override
|
||||
Future<Browser> launchBrowserInstance(Uri url, {bool debug = false}) async {
|
||||
return SafariIos(url, _screenInfo);
|
||||
}
|
||||
|
||||
@override
|
||||
Runtime get packageTestRuntime => Runtime.safari;
|
||||
|
||||
@override
|
||||
Future<void> prepare() async {
|
||||
final SafariIosLock lock = browserLock.safariIosLock;
|
||||
_screenInfo = SafariScreenInfo(
|
||||
lock.heightOfHeader, lock.heightOfFooter, lock.scaleFactor);
|
||||
|
||||
/// Create the directory to use for taking screenshots, if it does not
|
||||
/// exists.
|
||||
if (!environment.webUiSimulatorScreenshotsDirectory.existsSync()) {
|
||||
environment.webUiSimulatorScreenshotsDirectory.createSync();
|
||||
}
|
||||
// Temporary directories are deleted in the clenaup phase of after `felt`
|
||||
// runs the tests.
|
||||
temporaryDirectories.add(environment.webUiSimulatorScreenshotsDirectory);
|
||||
|
||||
await initIosSimulator();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> cleanup() async {}
|
||||
|
||||
@override
|
||||
String get packageTestConfigurationYamlFile => 'dart_test_safari.yaml';
|
||||
}
|
||||
|
||||
/// Runs an instance of Safari for iOS (i.e. mobile Safari).
|
||||
///
|
||||
/// Most of the communication with the browser is expected to happen via HTTP,
|
||||
/// so this exposes a bare-bones API. The browser starts as soon as the class is
|
||||
/// constructed, and is killed when [close] is called.
|
||||
///
|
||||
/// Any errors starting or running the process are reported through [onExit].
|
||||
class SafariIos extends Browser {
|
||||
|
||||
/// Starts a new instance of Safari open to the given [url], which may be a
|
||||
/// [Uri].
|
||||
factory SafariIos(Uri url, SafariScreenInfo screenInfo) {
|
||||
return SafariIos._(BrowserProcess(() async {
|
||||
// iOS-Safari
|
||||
// Uses `xcrun simctl`. It is a command line utility to control the
|
||||
// Simulator. For more details on interacting with the simulator:
|
||||
// https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/iOS_Simulator_Guide/InteractingwiththeiOSSimulator/InteractingwiththeiOSSimulator.html
|
||||
final io.Process process = await io.Process.start('xcrun', <String>[
|
||||
'simctl',
|
||||
'openurl', // Opens the url on Safari installed on the simulator.
|
||||
'booted', // The simulator is already booted.
|
||||
url.toString(),
|
||||
]);
|
||||
|
||||
return process;
|
||||
}), screenInfo);
|
||||
}
|
||||
|
||||
SafariIos._(this._process, this._screenInfo);
|
||||
final BrowserProcess _process;
|
||||
final SafariScreenInfo _screenInfo;
|
||||
|
||||
@override
|
||||
Future<void> get onExit => _process.onExit;
|
||||
|
||||
@override
|
||||
Future<void> close() => _process.close();
|
||||
|
||||
@override
|
||||
bool get supportsScreenshots => true;
|
||||
|
||||
@override
|
||||
|
||||
/// Capture a screenshot of entire simulator.
|
||||
///
|
||||
/// Example screenshot with dimensions: W x H.
|
||||
///
|
||||
/// <---------- W ------------->
|
||||
/// _____________________________
|
||||
/// | Phone Top bar (clock etc.) | Ʌ
|
||||
/// |_____________________________| |
|
||||
/// | Broswer search bar | |
|
||||
/// |_____________________________| |
|
||||
/// | Web page content | |
|
||||
/// | | |
|
||||
/// | |
|
||||
/// | | H
|
||||
/// | |
|
||||
/// | | |
|
||||
/// | | |
|
||||
/// | | |
|
||||
/// | | |
|
||||
/// |_____________________________| |
|
||||
/// | Phone footer bar | |
|
||||
/// |_____________________________| V
|
||||
///
|
||||
/// After taking the screenshot, the image is cropped as heigh as
|
||||
/// [_heightOfHeader] and [_heightOfFooter] from the top and bottom parts
|
||||
/// consecutively. Hence web content has the dimensions:
|
||||
///
|
||||
/// W x (H - [_heightOfHeader] - [_heightOfFooter])
|
||||
///
|
||||
/// [region] is used to decide which part of the web content will be used in
|
||||
/// test image. It includes starting coordinate x,y as well as height and
|
||||
/// width of the area to capture.
|
||||
///
|
||||
/// Uses simulator tool `xcrun simctl`'s 'screenshot' command.
|
||||
@override
|
||||
Future<Image> captureScreenshot(math.Rectangle<num>? region) async {
|
||||
final String screenshotTag = const Uuid().v4();
|
||||
|
||||
final String filename = 'screenshot$screenshotTag.png';
|
||||
|
||||
await iosSimulator.takeScreenshot(
|
||||
filename,
|
||||
environment.webUiSimulatorScreenshotsDirectory,
|
||||
);
|
||||
|
||||
final io.File file = io.File(path.join(
|
||||
environment.webUiSimulatorScreenshotsDirectory.path, filename));
|
||||
List<int> imageBytes;
|
||||
if (!file.existsSync()) {
|
||||
throw Exception('Failed to read the screenshot $filename.');
|
||||
}
|
||||
imageBytes = await file.readAsBytes();
|
||||
file.deleteSync();
|
||||
|
||||
final Image screenshot = decodePng(imageBytes)!;
|
||||
// Create an image with no footer and header. The _heightOfHeader,
|
||||
// _heightOfFooter values are already in real coordinates therefore
|
||||
// they don't need to be scaled.
|
||||
final Image content = copyCrop(
|
||||
screenshot,
|
||||
0,
|
||||
_screenInfo.heightOfHeader,
|
||||
screenshot.width,
|
||||
screenshot.height -
|
||||
_screenInfo.heightOfFooter -
|
||||
_screenInfo.heightOfHeader,
|
||||
);
|
||||
|
||||
if (region == null) {
|
||||
return content;
|
||||
} else {
|
||||
final math.Rectangle<num> scaledRegion = _scaleScreenshotRegion(region);
|
||||
return copyCrop(
|
||||
content,
|
||||
scaledRegion.left.toInt(),
|
||||
scaledRegion.top.toInt(),
|
||||
scaledRegion.width.toInt(),
|
||||
scaledRegion.height.toInt(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Perform a linear transform on the screenshot region to convert its
|
||||
/// dimensions from linear coordinated to coordinated on the phone screen.
|
||||
/// This uniform/isotropic scaling is done using [_scaleFactor].
|
||||
math.Rectangle<num> _scaleScreenshotRegion(math.Rectangle<num> region) {
|
||||
return math.Rectangle<num>(
|
||||
region.left * _screenInfo.scaleFactor,
|
||||
region.top * _screenInfo.scaleFactor,
|
||||
region.width * _screenInfo.scaleFactor,
|
||||
region.height * _screenInfo.scaleFactor,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -323,7 +323,7 @@ class BrowserPlatform extends PlatformPlugin {
|
||||
|
||||
if (!(await browserManager).supportsScreenshots) {
|
||||
print(
|
||||
'INFO: Skipping screenshot check for $filename. Current browser/OS '
|
||||
'Skipping screenshot check for $filename. Current browser/OS '
|
||||
'combination does not support screenshots.',
|
||||
);
|
||||
return shelf.Response.ok(json.encode('OK'));
|
||||
|
||||
@@ -236,8 +236,16 @@ bool get isIOS15 {
|
||||
domWindow.navigator.userAgent.contains('OS 15_');
|
||||
}
|
||||
|
||||
/// If set to true pretends that the current browser is iOS Safari.
|
||||
///
|
||||
/// Useful for tests. Do not use in production code.
|
||||
@visibleForTesting
|
||||
bool debugEmulateIosSafari = false;
|
||||
|
||||
/// Returns true if the browser is iOS Safari, false otherwise.
|
||||
bool get isIosSafari =>
|
||||
bool get isIosSafari => debugEmulateIosSafari || _isActualIosSafari;
|
||||
|
||||
bool get _isActualIosSafari =>
|
||||
browserEngine == BrowserEngine.webkit &&
|
||||
operatingSystem == OperatingSystem.iOs;
|
||||
|
||||
|
||||
@@ -41,10 +41,5 @@ dev_dependencies:
|
||||
path: ../../web_sdk/web_test_utils
|
||||
web_engine_tester:
|
||||
path: ../../web_sdk/web_engine_tester
|
||||
simulators:
|
||||
git:
|
||||
url: https://github.com/flutter/web_installers.git
|
||||
path: packages/simulators/
|
||||
ref: 9afed28b771da1c4e82a3382c4a2b31344c04522
|
||||
skia_gold_client:
|
||||
path: ../../testing/skia_gold_client
|
||||
|
||||
@@ -54,7 +54,6 @@ void testMain() {
|
||||
await matchGoldenFile('canvaskit_backdropfilter_blur_edges.png',
|
||||
region: region);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
}
|
||||
|
||||
@@ -814,7 +814,6 @@ void testMain() {
|
||||
await matchGoldenFile('canvaskit_empty_scene.png',
|
||||
region: const ui.Rect.fromLTRB(0, 0, 100, 100));
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:test/bootstrap/browser.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:ui/src/engine/browser_detection.dart';
|
||||
|
||||
import '../engine/canvas_test.dart';
|
||||
import 'common.dart';
|
||||
@@ -25,6 +24,5 @@ Future<void> testMain() async {
|
||||
setUpCanvasKitTest();
|
||||
|
||||
runCanvasTests(deviceClipRoundsOut: true);
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ void testMain() {
|
||||
group('SkParagraph', () {
|
||||
_textStyleTests();
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
void _blendModeTests() {
|
||||
|
||||
@@ -136,7 +136,6 @@ void testMain() {
|
||||
|
||||
await matchSceneGolden('canvaskit_inverse_colormatrix.png', builder.build(), write: true);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
}
|
||||
|
||||
@@ -1060,8 +1060,7 @@ void testMain() {
|
||||
_overlay,
|
||||
]);
|
||||
});
|
||||
// TODO(dit): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
// Used to test that the platform views and overlays are in the correct order in
|
||||
|
||||
@@ -91,7 +91,6 @@ void testMain() {
|
||||
recorder.endRecording(),
|
||||
region: kDefaultRegion,
|
||||
);
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
|
||||
@@ -201,7 +200,6 @@ void testMain() {
|
||||
recorder.endRecording(),
|
||||
region: kDefaultRegion,
|
||||
);
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
|
||||
@@ -356,7 +354,6 @@ void testMain() {
|
||||
}
|
||||
}
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isSafari);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,10 +46,7 @@ void testMain() {
|
||||
];
|
||||
}
|
||||
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
if (!isIosSafari) {
|
||||
setUpCanvasKitTest();
|
||||
}
|
||||
setUpCanvasKitTest();
|
||||
|
||||
group('ImageFilters', () {
|
||||
test('can be constructed', () {
|
||||
@@ -92,8 +89,7 @@ void testMain() {
|
||||
expect((paint.imageFilter! as ManagedSkiaObject<Object>).skiaObject, same(skiaFilter));
|
||||
});
|
||||
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
|
||||
group('MaskFilter', () {
|
||||
test('with 0 sigma can be set on a Paint', () {
|
||||
@@ -103,6 +99,5 @@ void testMain() {
|
||||
expect(() => paint.maskFilter = filter, isNot(throwsException));
|
||||
});
|
||||
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -112,7 +112,6 @@ void testMain() {
|
||||
region: kDefaultRegion,
|
||||
);
|
||||
});
|
||||
// TODO(yjbanov): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(yjbanov): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
import 'package:test/bootstrap/browser.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:ui/src/engine/browser_detection.dart';
|
||||
|
||||
import '../frame_timings_common.dart';
|
||||
import 'common.dart';
|
||||
@@ -20,5 +19,5 @@ void testMain() {
|
||||
test('collects frame timings', () async {
|
||||
await runFrameTimingsTest();
|
||||
});
|
||||
}, skip: isIosSafari); // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,7 +26,5 @@ void testMain() {
|
||||
|
||||
// Should find the existing instance and reuse it.
|
||||
expect(firstCanvasKitInstance, windowFlutterCanvasKit);
|
||||
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ void testMain() {
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isSafari);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,9 +39,7 @@ void testMain() {
|
||||
expect(MouseCursor.instance, isNotNull);
|
||||
expect(KeyboardBinding.instance, isNotNull);
|
||||
expect(PointerBinding.instance, isNotNull);
|
||||
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
DomElement? findGlassPane() {
|
||||
|
||||
@@ -22,6 +22,5 @@ void testMain() {
|
||||
'canvaskit (requested explicitly)');
|
||||
expect(domDocument.body!.getAttribute('flt-build-mode'), 'debug');
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,7 +55,5 @@ void testMain() {
|
||||
recorder.beginRecording(ui.Rect.zero);
|
||||
LayerSceneBuilder().addPicture(ui.Offset.zero, recorder.endRecording());
|
||||
});
|
||||
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,7 +101,6 @@ void testMain() {
|
||||
recorder.endRecording(),
|
||||
);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,5 @@ void testMain() {
|
||||
expect(original.getBounds(), rect1);
|
||||
expect(copy.getBounds(), rect1.expandToInclude(rect2));
|
||||
});
|
||||
},
|
||||
skip:
|
||||
isIosSafari); // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
});
|
||||
}
|
||||
|
||||
@@ -102,6 +102,5 @@ void testMain() {
|
||||
expect(data!.lengthInBytes, 10 * 15 * 4);
|
||||
expect(data.buffer.asUint32List().first, color.value);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -40,6 +40,5 @@ void testMain() {
|
||||
<bool>[true],
|
||||
);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,6 +57,5 @@ void testMain() {
|
||||
final ui.Scene scene = builder.build();
|
||||
expect(scene, isNotNull);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:test/bootstrap/browser.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:ui/src/engine/browser_detection.dart';
|
||||
|
||||
import '../engine/semantics/semantics_test.dart';
|
||||
import 'common.dart';
|
||||
@@ -25,6 +24,5 @@ Future<void> testMain() async {
|
||||
setUpCanvasKitTest();
|
||||
|
||||
runSemanticsTests();
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -158,7 +158,6 @@ void testMain() {
|
||||
await matchSceneGolden('canvaskit_shadermask_linear_translated.png',
|
||||
builder.build());
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
}
|
||||
|
||||
@@ -71,8 +71,7 @@ void testMain() {
|
||||
) as CkImageShader;
|
||||
expect(imageShader, isA<CkImageShader>());
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
const List<ui.Color> testColors = <ui.Color>[ui.Color(0xFFFFFF00), ui.Color(0xFFFFFFFF)];
|
||||
|
||||
@@ -124,6 +124,5 @@ void testMain() {
|
||||
// what's specified in the manifest, and the manifest takes precedence.
|
||||
expect(ahem.bytes.length, ahemData.lengthInBytes);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,8 +21,7 @@ void main() {
|
||||
void testMain() {
|
||||
group('skia_objects_cache', () {
|
||||
_tests();
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
void _tests() {
|
||||
|
||||
@@ -99,6 +99,5 @@ void testMain() {
|
||||
overlays.forEach(expectDisposed);
|
||||
expect(originalFactory.debugSurfaceCount, 1);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ void testMain() {
|
||||
// which cannot be a different size from the canvas.
|
||||
// TODO(hterkelsen): See if we can give a custom size for software
|
||||
// surfaces.
|
||||
}, skip: isFirefox || isIosSafari);
|
||||
}, skip: isFirefox);
|
||||
|
||||
test(
|
||||
'Surface creates new context when WebGL context is restored',
|
||||
@@ -186,5 +186,5 @@ void testMain() {
|
||||
expect(surface.htmlCanvas!.style.width, '5px');
|
||||
expect(surface.htmlCanvas!.style.height, '8px');
|
||||
});
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ void testMain() {
|
||||
recorder.endRecording(),
|
||||
);
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/71520
|
||||
}, skip: isSafari || isFirefox);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
import 'package:test/bootstrap/browser.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:ui/src/engine/browser_detection.dart';
|
||||
import 'package:ui/ui.dart' as ui;
|
||||
|
||||
import 'common.dart';
|
||||
@@ -66,6 +65,5 @@ void testMain() {
|
||||
// because the directionality of the 'h' is LTR.
|
||||
expect(boxes.single.direction, equals(ui.TextDirection.ltr));
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,8 +36,7 @@ void testMain() {
|
||||
);
|
||||
vertices.delete();
|
||||
});
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
|
||||
test('Vertices are not anti-aliased by default', () async {
|
||||
const ui.Rect region = ui.Rect.fromLTRB(0, 0, 500, 500);
|
||||
@@ -63,8 +62,6 @@ void testMain() {
|
||||
EnginePlatformDispatcher.instance.rasterizer!
|
||||
.draw(builder.build().layerTree);
|
||||
await matchGoldenFile('canvaskit_vertices_antialiased.png', region: region);
|
||||
|
||||
// TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040
|
||||
}, skip: isSafari);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +36,6 @@ void _testEach<T extends _BasicEventContext>(
|
||||
}
|
||||
}
|
||||
|
||||
/// Some methods in this class are skipped for iOS-Safari.
|
||||
// TODO(mdebbar): https://github.com/flutter/flutter/issues/60033
|
||||
|
||||
void main() {
|
||||
internalBootstrapBrowserTest(() => testMain);
|
||||
}
|
||||
@@ -54,13 +51,18 @@ void testMain() {
|
||||
});
|
||||
|
||||
test('ios workaround', () {
|
||||
debugEmulateIosSafari = true;
|
||||
addTearDown(() {
|
||||
debugEmulateIosSafari = false;
|
||||
});
|
||||
|
||||
final MockSafariPointerEventWorkaround mockSafariPointer =
|
||||
MockSafariPointerEventWorkaround();
|
||||
SafariPointerEventWorkaround.instance = mockSafariPointer;
|
||||
final PointerBinding instance = PointerBinding(createDomHTMLDivElement());
|
||||
expect(mockSafariPointer.workAroundInvoked, isIosSafari);
|
||||
instance.dispose();
|
||||
}, skip: !isIosSafari);
|
||||
}, skip: !isSafari);
|
||||
|
||||
test('_PointerEventContext generates expected events', () {
|
||||
if (!_PointerEventContext().isSupported) {
|
||||
|
||||
@@ -1927,11 +1927,7 @@ void _testPlatformView() {
|
||||
expect(shadowRoot.elementFromPoint(10, 50), child3);
|
||||
|
||||
semantics().semanticsEnabled = false;
|
||||
// TODO(yjbanov): unable to debug this test on iOS Safari as hacking on a
|
||||
// Linux machine. iOS Safari returns getBoundingClientRect
|
||||
// values that are half of desktop browsers, possibly due to
|
||||
// devicePixelRatio but need to confirm.
|
||||
}, skip: isIosSafari);
|
||||
});
|
||||
}
|
||||
|
||||
/// A facade in front of [ui.SemanticsUpdateBuilder.updateNode] that
|
||||
|
||||
Reference in New Issue
Block a user