Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f3a1040
[iOS] Fixes accessibilityIdentifier of platform views
zhongwuzw Jun 22, 2020
31ac8b6
Call embedded view only once
zhongwuzw Jun 22, 2020
bbe8615
Fix typo
zhongwuzw Jun 24, 2020
9325351
Revert "Add `GetBoundingRectAfterMutations` to EmbeddedViewParams to …
brianosman Jun 22, 2020
72a0120
Roll Dart SDK from 9fcac032b669 to cc5df58bd229 (22 revisions) (#19207)
skia-flutter-autoroll Jun 22, 2020
b1a90fe
Roll Skia from 50daeddf396f to 956ec8a8bcdd (5 revisions) (#19208)
skia-flutter-autoroll Jun 22, 2020
dfc3b8c
Roll Fuchsia Linux SDK from gaCdq... to oldar... (#19209)
skia-flutter-autoroll Jun 22, 2020
ea1ed12
Fix fonts.clear exception in IE11 (#19180)
ferhatb Jun 22, 2020
f042721
[iOS] text input methods to only call updateEditState once (#19161)
LongCatIsLooong Jun 22, 2020
2eb73ad
Roll Skia from 956ec8a8bcdd to abe2375dfb06 (5 revisions) (#19215)
skia-flutter-autoroll Jun 22, 2020
8b444d2
Enable firefox integration tests (#19164)
Jun 22, 2020
c4ba6f7
Roll Dart SDK from cc5df58bd229 to d872aea6a645 (8 revisions) (#19216)
skia-flutter-autoroll Jun 22, 2020
3c5533f
Roll Fuchsia Mac SDK from thz2_... to LRcV-... (#19217)
skia-flutter-autoroll Jun 22, 2020
b9f3ccf
Roll Skia from abe2375dfb06 to 3cf3d92b56fd (5 revisions) (#19218)
skia-flutter-autoroll Jun 22, 2020
8703ccd
Creates a new RenderMode for FlutterView (#19143)
bparrishMines Jun 22, 2020
9b49d62
[fuchsia] Adds --targets arg for build_fuchsia_artifacts.py (#19109)
filmil Jun 22, 2020
120a32f
Reland "Add `GetBoundingRectAfterMutations` to EmbeddedViewParams to …
Jun 22, 2020
febe307
JNI glue for calling PlatformViewsController.createOverlaySurface (#1…
jason-simmons Jun 22, 2020
67caf4e
Roll Skia from 3cf3d92b56fd to 6dd62cbdfa1c (4 revisions) (#19222)
skia-flutter-autoroll Jun 23, 2020
63d77f6
Roll Skia from 6dd62cbdfa1c to b444943db27d (1 revision) (#19225)
skia-flutter-autoroll Jun 23, 2020
9f1aa25
Roll Dart SDK from d872aea6a645 to 2d22e4ca26ef (14 revisions) (#19227)
skia-flutter-autoroll Jun 23, 2020
036383a
Implement PlatformViewsController.createOverlaySurface (#19226)
jason-simmons Jun 23, 2020
b1f71bb
Revert "Implement PlatformViewsController.createOverlaySurface (#1922…
Jun 23, 2020
f6ed9dd
Roll Fuchsia Linux SDK from oldar... to RGOLO... (#19229)
skia-flutter-autoroll Jun 23, 2020
9d1f724
Roll Skia from b444943db27d to fc2534692b97 (1 revision) (#19230)
skia-flutter-autoroll Jun 23, 2020
dfa91e9
Roll Dart SDK from 2d22e4ca26ef to d2628a71067d (3 revisions) (#19231)
skia-flutter-autoroll Jun 23, 2020
f1e821e
Roll Skia from fc2534692b97 to c2f46c16ab67 (2 revisions) (#19233)
skia-flutter-autoroll Jun 23, 2020
e41181b
Roll Fuchsia Mac SDK from LRcV-... to MvXLH... (#19234)
skia-flutter-autoroll Jun 23, 2020
8771e39
Roll Dart SDK from d2628a71067d to 912ae8230fb7 (6 revisions) (#19235)
skia-flutter-autoroll Jun 23, 2020
c1c9ee4
Roll Skia from c2f46c16ab67 to 2bf27f21f8d1 (1 revision) (#19236)
skia-flutter-autoroll Jun 23, 2020
4949a5b
Roll Skia from 2bf27f21f8d1 to e7ad8c0d3be3 (4 revisions) (#19237)
skia-flutter-autoroll Jun 23, 2020
810848b
Roll Dart SDK from 912ae8230fb7 to 5a6c1e515849 (6 revisions) (#19238)
skia-flutter-autoroll Jun 23, 2020
05a95c6
Roll Skia from e7ad8c0d3be3 to 044e8bc8c2da (4 revisions) (#19239)
skia-flutter-autoroll Jun 23, 2020
3e827e9
Use public accessor and move keep annotation (#19232)
Jun 23, 2020
7f2c194
Added experimental-emit-debug-metadata flag to flutter frontend serve…
Jun 23, 2020
aea75fa
Roll Skia from 044e8bc8c2da to 7f9aa5a2c609 (2 revisions) (#19240)
skia-flutter-autoroll Jun 23, 2020
df47a75
Fix the return type of CreateContext (#19223)
jason-simmons Jun 23, 2020
f67520b
Remove cbracken from reviewer auto-assign (#19244)
cbracken Jun 23, 2020
4930f17
Reland "Implement PlatformViewsController.createOverlaySurface" (#19245)
jason-simmons Jun 23, 2020
e0a376a
Roll Dart SDK from 5a6c1e515849 to 6b630c3719bd (7 revisions) (#19247)
skia-flutter-autoroll Jun 23, 2020
759d33e
Roll Fuchsia Linux SDK from RGOLO... to 3lfit... (#19243)
skia-flutter-autoroll Jun 23, 2020
971f2e6
Roll Skia from 7f9aa5a2c609 to 3b6b7478421b (7 revisions) (#19246)
skia-flutter-autoroll Jun 23, 2020
a1c275d
Run IOS unit tests on LUCI (#19141)
Jun 23, 2020
5c187f9
Roll Skia from 3b6b7478421b to fe02dd1ee6cb (5 revisions) (#19248)
skia-flutter-autoroll Jun 23, 2020
c153faa
Roll Fuchsia Mac SDK from MvXLH... to -UZgg... (#19250)
skia-flutter-autoroll Jun 23, 2020
acc6eff
Roll Skia from fe02dd1ee6cb to 5aaaeea4dad9 (1 revision) (#19251)
skia-flutter-autoroll Jun 24, 2020
535d4da
Roll Skia from 5aaaeea4dad9 to 22f246f5ad1d (1 revision) (#19256)
skia-flutter-autoroll Jun 24, 2020
219898a
Made [SemanticsObject setAccessibilityContainer] a noop. (#19249)
gaaclarke Jun 24, 2020
1e9061a
Roll Skia from 22f246f5ad1d to a3b0b30a78b6 (1 revision) (#19259)
skia-flutter-autoroll Jun 24, 2020
2fe162b
Roll Skia from a3b0b30a78b6 to 92c3b89d2396 (1 revision) (#19262)
skia-flutter-autoroll Jun 24, 2020
5d5eeea
Roll Dart SDK from 6b630c3719bd to 05167f3b6328 (16 revisions) (#19263)
skia-flutter-autoroll Jun 24, 2020
aea63fc
Roll Skia from 92c3b89d2396 to 322e4be6a1b1 (2 revisions) (#19264)
skia-flutter-autoroll Jun 24, 2020
e67e2d0
Roll Fuchsia Linux SDK from 3lfit... to 6Dz_3... (#19265)
skia-flutter-autoroll Jun 24, 2020
d0fd7b5
Roll Dart SDK from 05167f3b6328 to b41471670edc (2 revisions) (#19268)
skia-flutter-autoroll Jun 24, 2020
641ce34
Roll Fuchsia Mac SDK from -UZgg... to l2ubU... (#19269)
skia-flutter-autoroll Jun 24, 2020
935730f
Roll Dart SDK from b41471670edc to d8eb844e5d8f (5 revisions) (#19272)
skia-flutter-autoroll Jun 24, 2020
78fa47a
Fix format (#19261)
Jun 24, 2020
750f999
Move OnDisplayPlatformView JNI call (#19258)
Jun 24, 2020
04d601a
Update README.md (#19275)
Jun 24, 2020
f8d0225
Roll Skia from 322e4be6a1b1 to 8ee607cbc14d (17 revisions) (#19274)
skia-flutter-autoroll Jun 24, 2020
9a22f1c
EndFrame should be always called by rasterizer (#19257)
Jun 24, 2020
cc02baa
Android platform view static thread merging (#19242)
Jun 24, 2020
c181522
Roll Skia from 8ee607cbc14d to 632db1c74212 (8 revisions) (#19284)
skia-flutter-autoroll Jun 24, 2020
b26b60d
Make Shell::NotifyLowMemoryWarning trace (#19283)
dnfield Jun 24, 2020
5232243
Roll Fuchsia Linux SDK from 6Dz_3... to GqEvV... (#19285)
skia-flutter-autoroll Jun 24, 2020
1d458e5
Initial work toward converting the FlutterView to use a FlutterImageV…
jason-simmons Jun 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ reviewers:
- GaryQian
- jason-simmons
- iskakaushik
- cbracken
- flar

# A number of reviewers added to the pull request
Expand Down
10 changes: 5 additions & 5 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ vars = {
'skia_git': 'https://skia.googlesource.com',
# OCMock is for testing only so there is no google clone
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
'skia_revision': '50daeddf396f2f1cbb3a4a70ec785f8e3d4dca66',
'skia_revision': '632db1c742121f6176aa4627bac2ab1dc85cde5a',

# When updating the Dart revision, ensure that all entries that are
# dependencies of Dart are also updated to match the entries in the
# Dart SDK's DEPS file for that revision of Dart. The DEPS file for
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '9fcac032b669a772050fea629acf9732d0d80a7b',
'dart_revision': 'd8eb844e5d8f8c23166cb6877bcbe501d889ba38',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
Expand Down Expand Up @@ -354,7 +354,7 @@ deps = {
Var('dart_git') + '/package_config.git@9c586d04bd26fef01215fd10e7ab96a3050cfa64',

'src/third_party/dart/tools/sdks':
{'packages': [{'version': 'version:2.9.0-16.0.dev', 'package': 'dart/dart-sdk/${{platform}}'}], 'dep_type': 'cipd'},
{'packages': [{'version': 'version:2.9.0-18.0.dev', 'package': 'dart/dart-sdk/${{platform}}'}], 'dep_type': 'cipd'},

# WARNING: end of dart dependencies list that is cleaned up automatically - see create_updated_flutter_deps.py.

Expand Down Expand Up @@ -521,7 +521,7 @@ deps = {
'packages': [
{
'package': 'fuchsia/sdk/core/mac-amd64',
'version': 'thz2_oecn3_6i9chmPVP3cC5_WqCwF80ttrY9vqK4jYC'
'version': 'l2ubU17oZ4OMTqGo24etGpB7DBv7fY6qqTlAk0IZCB0C'
}
],
'condition': 'host_os == "mac"',
Expand All @@ -541,7 +541,7 @@ deps = {
'packages': [
{
'package': 'fuchsia/sdk/core/linux-amd64',
'version': 'gaCdqe5pvWAil0qJ9M7V7TWshgYOn7zOvYyKzM0wzwQC'
'version': 'GqEvVysSbeMClo7IZMsJWgJQZiDp9ZibF_n3cCpmaBEC'
}
],
'condition': 'host_os == "linux"',
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ toolchain. Most developers will interact with Flutter via the [Flutter
Framework](https://github.com/flutter/flutter), which provides a modern,
reactive framework, and a rich set of platform, layout and foundation widgets.

If you want to run/contribute to Flutter Web engine, more tooling can be
found at [felt](https://github.com/flutter/engine/tree/master/lib/web_ui/dev#whats-felt).
This is a tool written to make web engine development experience easy.

If you are new to Flutter, then you will find more general information
on the Flutter project, including tutorials and samples, on our Web
site at [Flutter.dev](https://flutter.dev). For specific information
Expand Down
1 change: 1 addition & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/Flutt
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterEngineProvider.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragmentActivity.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterImageView.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterSplashView.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterTextureView.java
Expand Down
5 changes: 3 additions & 2 deletions ci/licenses_golden/licenses_fuchsia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 3faf3cde076e4318d67e988eb33ab900
Signature: 249cd748150db631d8b4aaa058320686

UNUSED LICENSES:

Expand Down Expand Up @@ -1485,7 +1485,6 @@ FILE: ../../../fuchsia/sdk/linux/pkg/fdio/include/lib/fdio/fd.h
FILE: ../../../fuchsia/sdk/linux/pkg/fdio/meta.json
FILE: ../../../fuchsia/sdk/linux/pkg/fidl-async/meta.json
FILE: ../../../fuchsia/sdk/linux/pkg/fidl/meta.json
FILE: ../../../fuchsia/sdk/linux/pkg/fidl_base/include/lib/fidl/envelope_frames.h
FILE: ../../../fuchsia/sdk/linux/pkg/fidl_base/include/lib/fidl/internal_callable_traits.h
FILE: ../../../fuchsia/sdk/linux/pkg/fidl_base/include/lib/fidl/txn_header.h
FILE: ../../../fuchsia/sdk/linux/pkg/fidl_base/include/lib/fidl/visitor.h
Expand Down Expand Up @@ -3158,6 +3157,8 @@ FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.castwindow/window.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.component/constants.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.component/error.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.component/types.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.diagnostics/interest.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.diagnostics/severity.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.factory.wlan/iovar.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.feedback/crash_register.fidl
FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.feedback/data_register.fidl
Expand Down
8 changes: 7 additions & 1 deletion ci/licenses_golden/licenses_skia
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: cef2ee190e58d4bdbb36c83d85fd943a
Signature: b3e814b93da372c39dbd3a9b96a6ac4e

UNUSED LICENSES:

Expand Down Expand Up @@ -969,6 +969,7 @@ FILE: ../../../third_party/skia/bench/microbench.json
FILE: ../../../third_party/skia/bench/skpbench.json
FILE: ../../../third_party/skia/build/fuchsia/skqp/skqp.cmx
FILE: ../../../third_party/skia/build/fuchsia/skqp/test_manifest.json
FILE: ../../../third_party/skia/demos.skia.org/demos/hello_world/index.html
FILE: ../../../third_party/skia/docker/binary-size/Dockerfile
FILE: ../../../third_party/skia/docker/cmake-release/Dockerfile
FILE: ../../../third_party/skia/docker/skia-build-tools/Dockerfile
Expand Down Expand Up @@ -2338,6 +2339,7 @@ FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h
FILE: ../../../third_party/skia/include/codec/SkCodec.h
FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h
FILE: ../../../third_party/skia/include/core/SkFilterQuality.h
FILE: ../../../third_party/skia/include/core/SkPathBuilder.h
FILE: ../../../third_party/skia/include/core/SkPixmap.h
FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h
FILE: ../../../third_party/skia/include/core/SkPoint3.h
Expand Down Expand Up @@ -2425,6 +2427,7 @@ FILE: ../../../third_party/skia/src/core/SkMiniRecorder.h
FILE: ../../../third_party/skia/src/core/SkNextID.h
FILE: ../../../third_party/skia/src/core/SkOpts.cpp
FILE: ../../../third_party/skia/src/core/SkOpts.h
FILE: ../../../third_party/skia/src/core/SkPathBuilder.cpp
FILE: ../../../third_party/skia/src/core/SkPathPriv.h
FILE: ../../../third_party/skia/src/core/SkPictureCommon.h
FILE: ../../../third_party/skia/src/core/SkPictureImageGenerator.cpp
Expand Down Expand Up @@ -5219,9 +5222,12 @@ TYPE: LicenseType.bsd
FILE: ../../../third_party/skia/bench/TessellatePathBench.cpp
FILE: ../../../third_party/skia/experimental/skrive/include/SkRive.h
FILE: ../../../third_party/skia/experimental/skrive/src/Artboard.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/Color.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/Component.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/Drawable.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/Ellipse.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/Node.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/Paint.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/Shape.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/SkRive.cpp
FILE: ../../../third_party/skia/experimental/skrive/src/reader/BinaryReader.cpp
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_third_party
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 373a1ce95e3235f255bd904c4e32e9e8
Signature: a56d6bbdec23954f9cf69a9a3300d035

UNUSED LICENSES:

Expand Down
9 changes: 9 additions & 0 deletions common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ struct Settings {
/// to log a timeline event that tracks the latency of engine startup.
std::chrono::microseconds engine_start_timestamp = {};

/// Whether the application claims that it uses the android embedded view for
/// platform views.
///
/// A `true` value will result the raster task runner always run on the
/// platform thread.
// TODO(cyanlaz): Remove this when dynamic thread merging is done.
// https://github.com/flutter/flutter/issues/59930
bool use_embedded_view = false;

std::string ToString() const;
};

Expand Down
8 changes: 4 additions & 4 deletions flow/embedded_views.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Mutator {
//
// For example consider the following stack: [T1, T2, T3], where T1 is the top
// of the stack and T3 is the bottom of the stack. Applying this mutators stack
// to a platform view P1 will result in T1(T2(T2(P1))).
// to a platform view P1 will result in T1(T2(T3(P1))).
class MutatorsStack {
public:
MutatorsStack() = default;
Expand Down Expand Up @@ -287,16 +287,16 @@ class ExternalViewEmbedder {
virtual bool SubmitFrame(GrContext* context,
std::unique_ptr<SurfaceFrame> frame);

// This should only be called after |SubmitFrame|.
// This method provides the embedder a way to do additional tasks after
// |SubmitFrame|. After invoking this method, the current task on the
// TaskRunner should end immediately.
// |SubmitFrame|. For example, merge task runners if `should_resubmit_frame`
// is true.
//
// For example on the iOS embedder, threads are merged in this call.
// A new frame on the platform thread starts immediately. If the GPU thread
// still has some task running, there could be two frames being rendered
// concurrently, which causes undefined behaviors.
virtual void EndFrame(
bool should_resubmit_frame,
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) {}

FML_DISALLOW_COPY_AND_ASSIGN(ExternalViewEmbedder);
Expand Down
3 changes: 3 additions & 0 deletions flutter_frontend_server/lib/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ class _FlutterFrontendCompiler implements frontend.CompilerInterface {
_FlutterFrontendCompiler(StringSink output,
{bool unsafePackageSerialization,
bool useDebuggerModuleNames,
bool emitDebugMetadata,
frontend.ProgramTransformer transformer})
: _compiler = frontend.FrontendCompiler(output,
transformer: transformer,
useDebuggerModuleNames: useDebuggerModuleNames,
emitDebugMetadata: emitDebugMetadata,
unsafePackageSerialization: unsafePackageSerialization);

@override
Expand Down Expand Up @@ -171,6 +173,7 @@ Future<int> starter(
compiler ??= _FlutterFrontendCompiler(output,
transformer: ToStringTransformer(transformer, deleteToStringPackageUris),
useDebuggerModuleNames: options['debugger-module-names'] as bool,
emitDebugMetadata: options['experimental-emit-debug-metadata'] as bool,
unsafePackageSerialization:
options['unsafe-package-serialization'] as bool);

Expand Down
6 changes: 5 additions & 1 deletion lib/web_ui/dev/browser_lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ edge:
launcher_version: '1.2.0.0'
ios-safari:
majorVersion: 13
minorVersion: 5
minorVersion: 0
device: 'iPhone 11'
## geckodriver is used for testing Firefox Browser. It works with multiple
## Firefox Browser versions.
## See: https://github.com/mozilla/geckodriver/releases
geckodriver: 'v0.26.0'
76 changes: 72 additions & 4 deletions lib/web_ui/dev/driver_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import 'dart:io' as io;
import 'package:meta/meta.dart';
import 'package:path/path.dart' as pathlib;
import 'package:web_driver_installer/chrome_driver_installer.dart';
import 'package:web_driver_installer/firefox_driver_installer.dart';
import 'package:web_driver_installer/safari_driver_runner.dart';
import 'package:yaml/yaml.dart';

import 'chrome_installer.dart';
import 'common.dart';
Expand All @@ -16,10 +18,11 @@ import 'utils.dart';

/// [DriverManager] implementation for Chrome.
///
/// This manager can be used for both MacOS and Linux.
/// This manager can be used for both macOS and Linux.
class ChromeDriverManager extends DriverManager {
ChromeDriverManager(String browser) : super(browser);

@override
Future<void> _installDriver() async {
if (_browserDriverDir.existsSync()) {
_browserDriverDir.deleteSync(recursive: true);
Expand All @@ -45,6 +48,7 @@ class ChromeDriverManager extends DriverManager {
/// Throw an error if driver directory does not exists.
///
/// Driver should already exist on LUCI as a CIPD package.
@override
Future<void> _verifyDriverForLUCI() {
if (!_browserDriverDir.existsSync()) {
throw StateError('Failed to locate Chrome driver on LUCI on path:'
Expand All @@ -53,31 +57,93 @@ class ChromeDriverManager extends DriverManager {
return Future<void>.value();
}

@override
Future<void> _startDriver(String driverPath) async {
await startProcess('./chromedriver/chromedriver', ['--port=4444'],
workingDirectory: driverPath);
print('INFO: Driver started');
}
}

/// [DriverManager] implementation for Firefox.
///
/// This manager can be used for both macOS and Linux.
class FirefoxDriverManager extends DriverManager {
FirefoxDriverManager(String browser) : super(browser);

FirefoxDriverInstaller firefoxDriverInstaller =
FirefoxDriverInstaller(geckoDriverVersion: getLockedGeckoDriverVersion());

@override
Future<void> _installDriver() async {
if (_browserDriverDir.existsSync()) {
_browserDriverDir.deleteSync(recursive: true);
}

_browserDriverDir.createSync(recursive: true);
temporaryDirectories.add(_drivers);

final io.Directory temp = io.Directory.current;
io.Directory.current = _browserDriverDir;

try {
await firefoxDriverInstaller.install(alwaysInstall: false);
} finally {
io.Directory.current = temp;
}
}

/// Throw an error if driver directory does not exist.
///
/// Driver should already exist on LUCI as a CIPD package.
@override
Future<void> _verifyDriverForLUCI() {
if (!_browserDriverDir.existsSync()) {
throw StateError('Failed to locate Firefox driver on LUCI on path:'
'${_browserDriverDir.path}');
}
return Future<void>.value();
}

@override
Future<void> _startDriver(String driverPath) async {
await startProcess('./firefoxdriver/geckodriver', ['--port=4444'],
workingDirectory: driverPath);
print('INFO: Driver started');
}

/// Get the geckodriver version to be used with [FirefoxDriverInstaller].
///
/// For different versions of geckodriver. See:
/// https://github.com/mozilla/geckodriver/releases
static String getLockedGeckoDriverVersion() {
final YamlMap browserLock = BrowserLock.instance.configuration;
String geckoDriverReleaseVersion = browserLock['geckodriver'] as String;
return geckoDriverReleaseVersion;
}
}

/// [DriverManager] implementation for Safari.
///
/// This manager is will only be created/used for MacOS.
/// This manager is will only be created/used for macOS.
class SafariDriverManager extends DriverManager {
SafariDriverManager(String browser) : super(browser);

@override
Future<void> _installDriver() {
// No-op.
// macOS comes with Safari Driver installed.
return new Future<void>.value();
}

@override
Future<void> _verifyDriverForLUCI() {
// No-op.
// macOS comes with Safari Driver installed.
return Future<void>.value();
}

@override
Future<void> _startDriver(String driverPath) async {
final SafariDriverRunner safariDriverRunner = SafariDriverRunner();

Expand Down Expand Up @@ -137,11 +203,13 @@ abstract class DriverManager {
static DriverManager chooseDriver(String browser) {
if (browser == 'chrome') {
return ChromeDriverManager(browser);
} else if (browser == 'firefox') {
return FirefoxDriverManager(browser);
} else if (browser == 'safari' && io.Platform.isMacOS) {
return SafariDriverManager(browser);
} else {
throw StateError('Integration tests are only supported on Chrome or '
'on Safari (running on MacOS)');
throw StateError('Integration tests are only supported on Firefox, Chrome'
' and on Safari (running on macOS)');
}
}
}
Loading