Skip to content

Commit

Permalink
[web] remove dependency on web_installers and transitively all code t…
Browse files Browse the repository at this point in the history
…hat used it (flutter#32852)
  • Loading branch information
yjbanov authored Aug 4, 2022
1 parent 9638811 commit 7d1abfe
Show file tree
Hide file tree
Showing 45 changed files with 44 additions and 506 deletions.
21 changes: 0 additions & 21 deletions lib/web_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 1 addition & 22 deletions lib/web_ui/dev/browser_lock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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';
}
27 changes: 0 additions & 27 deletions lib/web_ui/dev/browser_lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion lib/web_ui/dev/chrome_installer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions lib/web_ui/dev/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.');
}
38 changes: 0 additions & 38 deletions lib/web_ui/dev/create_simulator.dart

This file was deleted.

7 changes: 0 additions & 7 deletions lib/web_ui/dev/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions lib/web_ui/dev/felt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -21,7 +20,6 @@ CommandRunner<bool> runner = CommandRunner<bool>(
)
..addCommand(BuildCommand())
..addCommand(CleanCommand())
..addCommand(CreateSimulatorCommand())
..addCommand(LicensesCommand())
..addCommand(RunCommand())
..addCommand(TestCommand());
Expand Down
90 changes: 0 additions & 90 deletions lib/web_ui/dev/safari_installation.dart

This file was deleted.

Loading

0 comments on commit 7d1abfe

Please sign in to comment.