diff --git a/lib/web_ui/README.md b/lib/web_ui/README.md index 4284463585a3c..d13e1ee6b145d 100644 --- a/lib/web_ui/README.md +++ b/lib/web_ui/README.md @@ -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 diff --git a/lib/web_ui/dev/browser_lock.dart b/lib/web_ui/dev/browser_lock.dart index 08b7a62eba5e6..5439ab648ee60 100644 --- a/lib/web_ui/dev/browser_lock.dart +++ b/lib/web_ui/dev/browser_lock.dart @@ -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'; -} diff --git a/lib/web_ui/dev/browser_lock.yaml b/lib/web_ui/dev/browser_lock.yaml index d6f26f21ab262..f816d27932093 100644 --- a/lib/web_ui/dev/browser_lock.yaml +++ b/lib/web_ui/dev/browser_lock.yaml @@ -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 diff --git a/lib/web_ui/dev/chrome_installer.dart b/lib/web_ui/dev/chrome_installer.dart index e5ed8c889fd76..dd3cafec47aed 100644 --- a/lib/web_ui/dev/chrome_installer.dart +++ b/lib/web_ui/dev/chrome_installer.dart @@ -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 diff --git a/lib/web_ui/dev/common.dart b/lib/web_ui/dev/common.dart index addbc68445eda..b73dc7908ceca 100644 --- a/lib/web_ui/dev/common.dart +++ b/lib/web_ui/dev/common.dart @@ -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 kAllBrowserNames = [ 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.'); } diff --git a/lib/web_ui/dev/create_simulator.dart b/lib/web_ui/dev/create_simulator.dart deleted file mode 100644 index 0ec86fd8f5455..0000000000000 --- a/lib/web_ui/dev/create_simulator.dart +++ /dev/null @@ -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 with ArgUtils { - @override - String get name => 'create_simulator'; - - @override - String get description => 'Creates mobile simulators.'; - - @override - FutureOr 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; - } -} diff --git a/lib/web_ui/dev/environment.dart b/lib/web_ui/dev/environment.dart index 7fe5f90834b06..1c5530ba2a0d0 100644 --- a/lib/web_ui/dev/environment.dart +++ b/lib/web_ui/dev/environment.dart @@ -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, diff --git a/lib/web_ui/dev/felt.dart b/lib/web_ui/dev/felt.dart index 6088acbc0ebed..1048c8bdcf3a6 100644 --- a/lib/web_ui/dev/felt.dart +++ b/lib/web_ui/dev/felt.dart @@ -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 runner = CommandRunner( ) ..addCommand(BuildCommand()) ..addCommand(CleanCommand()) - ..addCommand(CreateSimulatorCommand()) ..addCommand(LicensesCommand()) ..addCommand(RunCommand()) ..addCommand(TestCommand()); diff --git a/lib/web_ui/dev/safari_installation.dart b/lib/web_ui/dev/safari_installation.dart deleted file mode 100644 index 497ae06dc7f86..0000000000000 --- a/lib/web_ui/dev/safari_installation.dart +++ /dev/null @@ -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 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 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(), - ); -} diff --git a/lib/web_ui/dev/safari_ios.dart b/lib/web_ui/dev/safari_ios.dart deleted file mode 100644 index c180e3832d218..0000000000000 --- a/lib/web_ui/dev/safari_ios.dart +++ /dev/null @@ -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 launchBrowserInstance(Uri url, {bool debug = false}) async { - return SafariIos(url, _screenInfo); - } - - @override - Runtime get packageTestRuntime => Runtime.safari; - - @override - Future 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 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', [ - '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 get onExit => _process.onExit; - - @override - Future 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 captureScreenshot(math.Rectangle? 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 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 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 _scaleScreenshotRegion(math.Rectangle region) { - return math.Rectangle( - region.left * _screenInfo.scaleFactor, - region.top * _screenInfo.scaleFactor, - region.width * _screenInfo.scaleFactor, - region.height * _screenInfo.scaleFactor, - ); - } -} diff --git a/lib/web_ui/dev/test_platform.dart b/lib/web_ui/dev/test_platform.dart index 2c33c2e2d2180..2a80684c7b4f5 100644 --- a/lib/web_ui/dev/test_platform.dart +++ b/lib/web_ui/dev/test_platform.dart @@ -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')); diff --git a/lib/web_ui/lib/src/engine/browser_detection.dart b/lib/web_ui/lib/src/engine/browser_detection.dart index 24ab65bcfebd1..6e263e2ac5593 100644 --- a/lib/web_ui/lib/src/engine/browser_detection.dart +++ b/lib/web_ui/lib/src/engine/browser_detection.dart @@ -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; diff --git a/lib/web_ui/pubspec.yaml b/lib/web_ui/pubspec.yaml index e623366630820..8ccf08592378d 100644 --- a/lib/web_ui/pubspec.yaml +++ b/lib/web_ui/pubspec.yaml @@ -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 diff --git a/lib/web_ui/test/canvaskit/backdrop_filter_golden_test.dart b/lib/web_ui/test/canvaskit/backdrop_filter_golden_test.dart index a8d445b50fcf5..67d4b003a5b1c 100644 --- a/lib/web_ui/test/canvaskit/backdrop_filter_golden_test.dart +++ b/lib/web_ui/test/canvaskit/backdrop_filter_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/canvas_golden_test.dart b/lib/web_ui/test/canvaskit/canvas_golden_test.dart index 8b1fc7b8d92ac..77a3a57eb7fc5 100644 --- a/lib/web_ui/test/canvaskit/canvas_golden_test.dart +++ b/lib/web_ui/test/canvaskit/canvas_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/canvas_test.dart b/lib/web_ui/test/canvaskit/canvas_test.dart index d8cbb1f0a6d15..cacb5ed4c6c3f 100644 --- a/lib/web_ui/test/canvaskit/canvas_test.dart +++ b/lib/web_ui/test/canvaskit/canvas_test.dart @@ -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 testMain() async { setUpCanvasKitTest(); runCanvasTests(deviceClipRoundsOut: true); - // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040 - }, skip: isIosSafari); + }); } diff --git a/lib/web_ui/test/canvaskit/canvaskit_api_test.dart b/lib/web_ui/test/canvaskit/canvaskit_api_test.dart index a320f2d8bea85..8418965a164da 100644 --- a/lib/web_ui/test/canvaskit/canvaskit_api_test.dart +++ b/lib/web_ui/test/canvaskit/canvaskit_api_test.dart @@ -59,8 +59,7 @@ void testMain() { group('SkParagraph', () { _textStyleTests(); }); - // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040 - }, skip: isIosSafari); + }); } void _blendModeTests() { diff --git a/lib/web_ui/test/canvaskit/color_filter_golden_test.dart b/lib/web_ui/test/canvaskit/color_filter_golden_test.dart index 475f8fc63148f..9833ee1fd577c 100644 --- a/lib/web_ui/test/canvaskit/color_filter_golden_test.dart +++ b/lib/web_ui/test/canvaskit/color_filter_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/embedded_views_test.dart b/lib/web_ui/test/canvaskit/embedded_views_test.dart index 1e459785a4500..61ce23a724830 100644 --- a/lib/web_ui/test/canvaskit/embedded_views_test.dart +++ b/lib/web_ui/test/canvaskit/embedded_views_test.dart @@ -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 diff --git a/lib/web_ui/test/canvaskit/fallback_fonts_golden_test.dart b/lib/web_ui/test/canvaskit/fallback_fonts_golden_test.dart index c0b731620672d..ed1293b813e23 100644 --- a/lib/web_ui/test/canvaskit/fallback_fonts_golden_test.dart +++ b/lib/web_ui/test/canvaskit/fallback_fonts_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/filter_test.dart b/lib/web_ui/test/canvaskit/filter_test.dart index c21684f18d04a..0c3d6b46dcd57 100644 --- a/lib/web_ui/test/canvaskit/filter_test.dart +++ b/lib/web_ui/test/canvaskit/filter_test.dart @@ -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).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); + }); } diff --git a/lib/web_ui/test/canvaskit/flutter_tester_emulation_golden_test.dart b/lib/web_ui/test/canvaskit/flutter_tester_emulation_golden_test.dart index 455af77659743..add30b29ca95d 100644 --- a/lib/web_ui/test/canvaskit/flutter_tester_emulation_golden_test.dart +++ b/lib/web_ui/test/canvaskit/flutter_tester_emulation_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/frame_timings_test.dart b/lib/web_ui/test/canvaskit/frame_timings_test.dart index ca0ee4df79917..7cab6bc8f0247 100644 --- a/lib/web_ui/test/canvaskit/frame_timings_test.dart +++ b/lib/web_ui/test/canvaskit/frame_timings_test.dart @@ -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 + }); } diff --git a/lib/web_ui/test/canvaskit/hot_restart_test.dart b/lib/web_ui/test/canvaskit/hot_restart_test.dart index c99bc57e6963a..4923c3b6e8951 100644 --- a/lib/web_ui/test/canvaskit/hot_restart_test.dart +++ b/lib/web_ui/test/canvaskit/hot_restart_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/image_golden_test.dart b/lib/web_ui/test/canvaskit/image_golden_test.dart index e7bda2e34465d..afcd198e7e714 100644 --- a/lib/web_ui/test/canvaskit/image_golden_test.dart +++ b/lib/web_ui/test/canvaskit/image_golden_test.dart @@ -54,7 +54,6 @@ void testMain() { isTrue, ); }); - // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040 }, skip: isSafari); } diff --git a/lib/web_ui/test/canvaskit/initialization_services_vs_ui_test.dart b/lib/web_ui/test/canvaskit/initialization_services_vs_ui_test.dart index 1268aa12a6b9a..31820129fb49b 100644 --- a/lib/web_ui/test/canvaskit/initialization_services_vs_ui_test.dart +++ b/lib/web_ui/test/canvaskit/initialization_services_vs_ui_test.dart @@ -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() { diff --git a/lib/web_ui/test/canvaskit/initialization_test.dart b/lib/web_ui/test/canvaskit/initialization_test.dart index 202983939e49f..53f3dd34674ec 100644 --- a/lib/web_ui/test/canvaskit/initialization_test.dart +++ b/lib/web_ui/test/canvaskit/initialization_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/layer_test.dart b/lib/web_ui/test/canvaskit/layer_test.dart index dfc4f7ea73349..8a1fdcaaf8c52 100644 --- a/lib/web_ui/test/canvaskit/layer_test.dart +++ b/lib/web_ui/test/canvaskit/layer_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/linear_gradient_golden_test.dart b/lib/web_ui/test/canvaskit/linear_gradient_golden_test.dart index 465e4030493c8..9cca66b39db3f 100644 --- a/lib/web_ui/test/canvaskit/linear_gradient_golden_test.dart +++ b/lib/web_ui/test/canvaskit/linear_gradient_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/path_test.dart b/lib/web_ui/test/canvaskit/path_test.dart index 5ef031f9aa9f0..febfbf89b63ff 100644 --- a/lib/web_ui/test/canvaskit/path_test.dart +++ b/lib/web_ui/test/canvaskit/path_test.dart @@ -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 + }); } diff --git a/lib/web_ui/test/canvaskit/picture_test.dart b/lib/web_ui/test/canvaskit/picture_test.dart index b082d13d6e260..5ed13acc1edcf 100644 --- a/lib/web_ui/test/canvaskit/picture_test.dart +++ b/lib/web_ui/test/canvaskit/picture_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/platform_dispatcher_test.dart b/lib/web_ui/test/canvaskit/platform_dispatcher_test.dart index e13eff9584f92..85421d24f70ab 100644 --- a/lib/web_ui/test/canvaskit/platform_dispatcher_test.dart +++ b/lib/web_ui/test/canvaskit/platform_dispatcher_test.dart @@ -40,6 +40,5 @@ void testMain() { [true], ); }); - // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040 - }, skip: isIosSafari); + }); } diff --git a/lib/web_ui/test/canvaskit/scene_test.dart b/lib/web_ui/test/canvaskit/scene_test.dart index 2dd134a2ca5ec..9395c067bb3d7 100644 --- a/lib/web_ui/test/canvaskit/scene_test.dart +++ b/lib/web_ui/test/canvaskit/scene_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/semantics_test.dart b/lib/web_ui/test/canvaskit/semantics_test.dart index 7053c3d7958b2..7df21aeeaac19 100644 --- a/lib/web_ui/test/canvaskit/semantics_test.dart +++ b/lib/web_ui/test/canvaskit/semantics_test.dart @@ -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 testMain() async { setUpCanvasKitTest(); runSemanticsTests(); - // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040 - }, skip: isIosSafari); + }); } diff --git a/lib/web_ui/test/canvaskit/shader_mask_golden_test.dart b/lib/web_ui/test/canvaskit/shader_mask_golden_test.dart index eb53ed554bc5a..3b7481496242a 100644 --- a/lib/web_ui/test/canvaskit/shader_mask_golden_test.dart +++ b/lib/web_ui/test/canvaskit/shader_mask_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/shader_test.dart b/lib/web_ui/test/canvaskit/shader_test.dart index 2f44ed7e7a837..0c0dcda41845c 100644 --- a/lib/web_ui/test/canvaskit/shader_test.dart +++ b/lib/web_ui/test/canvaskit/shader_test.dart @@ -71,8 +71,7 @@ void testMain() { ) as CkImageShader; expect(imageShader, isA()); }); - // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040 - }, skip: isIosSafari); + }); } const List testColors = [ui.Color(0xFFFFFF00), ui.Color(0xFFFFFFFF)]; diff --git a/lib/web_ui/test/canvaskit/skia_font_collection_test.dart b/lib/web_ui/test/canvaskit/skia_font_collection_test.dart index 76a0f56b24f27..8d667d8af12ec 100644 --- a/lib/web_ui/test/canvaskit/skia_font_collection_test.dart +++ b/lib/web_ui/test/canvaskit/skia_font_collection_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/skia_objects_cache_test.dart b/lib/web_ui/test/canvaskit/skia_objects_cache_test.dart index 4602cc279987f..68e2e92458b7b 100644 --- a/lib/web_ui/test/canvaskit/skia_objects_cache_test.dart +++ b/lib/web_ui/test/canvaskit/skia_objects_cache_test.dart @@ -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() { diff --git a/lib/web_ui/test/canvaskit/surface_factory_test.dart b/lib/web_ui/test/canvaskit/surface_factory_test.dart index bdefb5a9214fb..9fa98d64f0ba7 100644 --- a/lib/web_ui/test/canvaskit/surface_factory_test.dart +++ b/lib/web_ui/test/canvaskit/surface_factory_test.dart @@ -99,6 +99,5 @@ void testMain() { overlays.forEach(expectDisposed); expect(originalFactory.debugSurfaceCount, 1); }); - // TODO(hterkelsen): https://github.com/flutter/flutter/issues/60040 - }, skip: isIosSafari); + }); } diff --git a/lib/web_ui/test/canvaskit/surface_test.dart b/lib/web_ui/test/canvaskit/surface_test.dart index 123fff01514f3..74038d52a4591 100644 --- a/lib/web_ui/test/canvaskit/surface_test.dart +++ b/lib/web_ui/test/canvaskit/surface_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/sweep_gradient_golden_test.dart b/lib/web_ui/test/canvaskit/sweep_gradient_golden_test.dart index 53af0dbc8505e..ee90f20da1b4d 100644 --- a/lib/web_ui/test/canvaskit/sweep_gradient_golden_test.dart +++ b/lib/web_ui/test/canvaskit/sweep_gradient_golden_test.dart @@ -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); } diff --git a/lib/web_ui/test/canvaskit/text_test.dart b/lib/web_ui/test/canvaskit/text_test.dart index 4b6bb478bac32..ec5621731a14a 100644 --- a/lib/web_ui/test/canvaskit/text_test.dart +++ b/lib/web_ui/test/canvaskit/text_test.dart @@ -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); + }); } diff --git a/lib/web_ui/test/canvaskit/vertices_test.dart b/lib/web_ui/test/canvaskit/vertices_test.dart index 0db4f8f31fd7b..5b871ff1b89b2 100644 --- a/lib/web_ui/test/canvaskit/vertices_test.dart +++ b/lib/web_ui/test/canvaskit/vertices_test.dart @@ -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); } diff --git a/lib/web_ui/test/engine/pointer_binding_test.dart b/lib/web_ui/test/engine/pointer_binding_test.dart index 6d843e6d0449b..44ff17a0017e9 100644 --- a/lib/web_ui/test/engine/pointer_binding_test.dart +++ b/lib/web_ui/test/engine/pointer_binding_test.dart @@ -36,9 +36,6 @@ void _testEach( } } -/// 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) { diff --git a/lib/web_ui/test/engine/semantics/semantics_test.dart b/lib/web_ui/test/engine/semantics/semantics_test.dart index 907d365a03d7a..84051cc5dd787 100644 --- a/lib/web_ui/test/engine/semantics/semantics_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_test.dart @@ -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