dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.57k forks source link

migrate js-interop tests out of lib_2/html #40408

Open sigmundch opened 4 years ago

sigmundch commented 4 years ago

Many js-interop features work without the DOM and are being used in dart2js's server mode (e.g. sass uses js-interop within node.js).

I'd like to do most of the js-interop testing in a way that doesn't require the browser to be present. Many js-interop tests are DOM independent but use dart:html for something non essential.

We'd like to migrate them, move them under lib_2/js/, and start running them in configurations like dart2js-d8.

sigmundch commented 3 years ago

@rileyporter - with your recent change, is it possible that this issue is addressed already?

rileyporter commented 3 years ago

Yes, I think this is addressed with my js_util test refactor. The only other lib_2/html tests that use js_util are:

All of those tests are not testing js_util functionality directly, but are using js_util to test other functionality on window, iframe or other dart:html objects.

sigmundch commented 3 years ago

Nice!

I just realized that this bug was also intended to track tests that cover usage of package:js. It appears that, similar to what you noticed with js-util, there are a mix of tests in lib/html using it, some to cover how package:js works and some to use package:js in order to test something else.

rileyporter commented 3 years ago

For tracking, this merged change migrated js_util tests out of lib/html: https://dart-review.googlesource.com/c/sdk/+/185281

Still need to migrate other package:js functionality tests out of lib/html