mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 17:51:33 +00:00
Adding in initial support for all HTML*Element interfaces. (#568)
* Adding in initial support for all HTML*Element interfaces. * Fix camelcasing of short HTML interface names * Disabling span test as breaks on taskcluster
This commit is contained in:
committed by
Alex Crichton
parent
55e2ce9b53
commit
67b43ee389
35
crates/web-sys/tests/all/html_html_element.rs
Normal file
35
crates/web-sys/tests/all/html_html_element.rs
Normal file
@ -0,0 +1,35 @@
|
||||
use super::websys_project;
|
||||
|
||||
#[test]
|
||||
fn html_html_element() {
|
||||
websys_project()
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
r#"
|
||||
#![feature(use_extern_macros, wasm_custom_section)]
|
||||
extern crate wasm_bindgen;
|
||||
use wasm_bindgen::prelude::*;
|
||||
extern crate web_sys;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn test_html_html_element(element: &web_sys::HtmlHtmlElement) {
|
||||
assert_eq!(element.version(), "", "Shouldn't have a version");
|
||||
element.set_version("4");
|
||||
assert_eq!(element.version(), "4", "Should have a version");
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.file(
|
||||
"test.js",
|
||||
r#"
|
||||
import * as assert from "assert";
|
||||
import * as wasm from "./out";
|
||||
|
||||
export function test() {
|
||||
let html = document.createElement("html");
|
||||
wasm.test_html_html_element(html);
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.test();
|
||||
}
|
Reference in New Issue
Block a user