Skip to content

Commit 487a004

Browse files
committed
[test] Require Dart 3.3, drop dependency on pkg:js
1 parent a3f05ec commit 487a004

File tree

15 files changed

+1402
-3260
lines changed

15 files changed

+1402
-3260
lines changed

.github/workflows/dart.yml

+62-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgs/test/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.25.3-wip
2+
3+
* Require Dart 3.3
4+
15
## 1.25.2
26

37
* Fix a bug running browser tests with paths containing windows directory

pkgs/test/lib/src/runner/browser/compilers/dart2js.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@ class Dart2JsSupport extends CompilerSupport with JsHtmlWrapper {
112112
var jsPath = p.join(dir, '${p.basename(dartPath)}.browser_test.dart.js');
113113
var bootstrapContent = '''
114114
${suiteConfig.metadata.languageVersionComment ?? await rootPackageLanguageVersionComment}
115+
import 'dart:js_interop';
115116
import 'package:test/src/bootstrap/browser.dart';
116117
import 'package:test/src/runner/browser/dom.dart' as dom;
117118
118119
import '${await absoluteUri(dartPath)}' as test;
119120
120121
void main() {
121-
dom.window.console.log(r'Startup for test path $dartPath');
122+
dom.window.console.log(r'Startup for test path $dartPath'.toJS);
122123
internalBootstrapBrowserTest(() => test.main);
123124
}
124125
''';

pkgs/test/lib/src/runner/browser/dom.dart

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
import 'dart:js_interop';
56
import 'dart:js_util' as js_util;
67

7-
import 'package:js/js.dart';
8-
98
@JS()
109
@staticInterop
1110
class Window extends EventTarget {}
@@ -38,8 +37,8 @@ external Window get window;
3837
class Console {}
3938

4039
extension ConsoleExtension on Console {
41-
external void log(Object? object);
42-
external void warn(Object? object);
40+
external void log(JSString object);
41+
external void warn(JSString object);
4342
}
4443

4544
@JS()
@@ -238,7 +237,7 @@ HTMLIFrameElement createHTMLIFrameElement() =>
238237
class WebSocket extends EventTarget {}
239238

240239
extension WebSocketExtension on WebSocket {
241-
external void send(Object? data);
240+
external void send(JSAny? data);
242241
}
243242

244243
WebSocket createWebSocket(String url) =>

pkgs/test/lib/src/runner/browser/post_message_channel.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
import 'dart:js_interop';
56
import 'dart:js_util';
67

78
import 'package:stream_channel/stream_channel.dart';
@@ -13,7 +14,7 @@ import 'dom.dart' as dom;
1314
///
1415
/// Sends a [MessagePort] to the host page for the channel.
1516
StreamChannel<Object?> postMessageChannel() {
16-
dom.window.console.log('Suite starting, sending channel to host');
17+
dom.window.console.log('Suite starting, sending channel to host'.toJS);
1718
var controller = StreamChannelController<Object?>(sync: true);
1819
var channel = dom.createMessageChannel();
1920
dom.window.parent

0 commit comments

Comments
 (0)