wasm-bindgen/crates/web-sys/tests/wasm
Alex Crichton eee71de0ce
Support asynchronous tests (#600)
* Tweak the implementation of heap closures

This commit updates the implementation of the `Closure` type to internally store
an `Rc` and be suitable for dropping a `Closure` during the execution of the
closure. This is currently needed for promises but may be generally useful as
well!

* Support asynchronous tests

This commit adds support for executing tests asynchronously. This is modeled
by tests returning a `Future` instead of simply executing inline, and is
signified with `#[wasm_bindgen_test(async)]`.

Support for this is added through a new `wasm-bindgen-futures` crate which is a
binding between the `futures` crate and JS `Promise` objects.

Lots more details can be found in the details of the commit, but one of the end
results is that the `web-sys` tests are now entirely contained in the same test
suite and don't need `npm install` to be run to execute them!

* Review tweaks

* Add some bindings for `Function.call` to `js_sys`

Name them `call0`, `call1`, `call2`, ... for the number of arguments being
passed.

* Use oneshots channels with `JsFuture`

It did indeed clean up the implementation!
2018-08-01 15:52:24 -05:00
..
anchor_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
body_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
br_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
button_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
div_element.rs No need to work around ourselves any more 2018-07-30 11:10:48 -07:00
element.js Add unit test for HtmlSelectElement binding. (#598) 2018-08-01 00:01:03 -05:00
element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
event.js Support asynchronous tests (#600) 2018-08-01 15:52:24 -05:00
event.rs Support asynchronous tests (#600) 2018-08-01 15:52:24 -05:00
head_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
headers.js Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
headers.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
heading_element.rs Testing web-sys for input, heading and title elements. (#596) 2018-07-31 08:57:16 -07:00
history.rs Add unit test for HtmlSelectElement binding. (#598) 2018-08-01 00:01:03 -05:00
hr_element.rs Add unit test for HtmlHrElement web_sys binding (#591) 2018-07-30 18:25:48 -07:00
html_element.rs Add unit test for HtmlSelectElement binding. (#598) 2018-08-01 00:01:03 -05:00
html_html_element.rs No need to work around ourselves any more 2018-07-30 11:10:48 -07:00
input_element.rs Testing web-sys for input, heading and title elements. (#596) 2018-07-31 08:57:16 -07:00
main.rs Support asynchronous tests (#600) 2018-08-01 15:52:24 -05:00
response.js Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
response.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
script_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
select_element.rs Add unit test for HtmlSelectElement binding. (#598) 2018-08-01 00:01:03 -05:00
span_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
style_element.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00
title_element.rs Testing web-sys for input, heading and title elements. (#596) 2018-07-31 08:57:16 -07:00
xpath_result.rs Move web-sys tests to the new test framework 2018-07-30 11:07:07 -07:00