wasm test suite (#1116)

* wasm: add test suite using headlless chrome
This commit is contained in:
Brad Peabody
2020-05-23 05:12:01 -07:00
committed by GitHub
parent dda576e80b
commit 95f509b109
13 changed files with 447 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package main
import "syscall/js"
func main() {
ch := make(chan bool, 1)
println("1")
js.Global().
Get("document").
Call("querySelector", "#main").
Set("innerHTML", `<button id="testbtn">Test</button>`)
js.Global().
Get("document").
Call("querySelector", "#testbtn").
Call("addEventListener", "click",
js.FuncOf(func(this js.Value, args []js.Value) interface{} {
println("2")
ch <- true
println("3")
return nil
}))
println("4")
v := <-ch
println(v)
}