Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[web] Test harness fixes for Dart2Wasm. #37560

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions lib/web_ui/dev/chrome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ class Chrome extends Browser {
final String dir = environment.webUiDartToolDir.createTempSync('test_chrome_user_data_').resolveSymbolicLinksSync();
final String jsFlags = enableWasmGC ? <String>[
'--experimental-wasm-gc',
'--wasm-gc-js-interop',
'--experimental-wasm-stack-switching',
'--experimental-wasm-type-reflection',
'--wasm-gc-js-interop',
].join(' ') : '';
final List<String> args = <String>[
if (jsFlags.isNotEmpty) '--js-flags=$jsFlags',
Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dev_dependencies:
shelf_static: any
shelf_web_socket: any
stack_trace: any
stream_channel: any
stream_channel: 2.1.1
test: 1.22.0
test_api: any
test_core: any
Expand Down
10 changes: 9 additions & 1 deletion web_sdk/web_engine_tester/lib/static/host.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import 'package:ui/src/engine/dom.dart';

/// A class defined in content shell, used to control its behavior.
@JS()
class _TestRunner {
@staticInterop
class _TestRunner {}

extension _TestRunnerExtension on _TestRunner {
external void waitUntilDone();
}

Expand All @@ -32,15 +35,20 @@ external _TestRunner? get testRunner; // ignore: library_private_types_in_public
/// debugging.
@JS()
@anonymous
@staticInterop
class _JSApi {
external factory _JSApi({void Function() resume, void Function() restartCurrent});
}

extension _JSApiExtension on _JSApi {
/// Causes the test runner to resume running, as though the user had clicked
/// the "play" button.
// ignore: unused_element
external Function get resume;

/// Causes the test runner to restart the current test once it finishes
/// running.
// ignore: unused_element
external Function get restartCurrent;
}

Expand Down
2 changes: 1 addition & 1 deletion web_sdk/web_engine_tester/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:

dependencies:
js: 0.6.4
stream_channel: 2.1.0
stream_channel: 2.1.1
test: 1.22.0
webkit_inspection_protocol: 1.0.0
stack_trace: 1.10.0
Expand Down