Comments (5)
Hmm.. I don't have a mac. But I will see if I can find something.
from wasmbrowsertest.
@hajimehoshi - does it work if you manually paste the commands in a browser console? I just tried the following and got null
for webgl
> let cc = document.createElement("canvas")
< undefined
> cc.getContext("2d")
< CanvasRenderingContext2D {canvas: canvas, globalAlpha: 1, globalCompositeOperation: 'source-over', filter: 'none', imageSmoothingEnabled: true, …}
> cc.getContext("webgl")
< null
from wasmbrowsertest.
The result was the same on the console.
EDIT: skipping to get 2d canvas changed the result:
from wasmbrowsertest.
Hm, apparently this is the same on Windows
> cat .\examples\test\main_test.go
package main_test
import (
"syscall/js"
"testing"
)
func TestWebGL(t *testing.T) {
window := js.Global().Get("window")
document := window.Get("document")
body := document.Get("body")
canvas := document.Call("createElement", "canvas")
body.Call("appendChild", canvas)
if context := canvas.Call("getContext", "webgl"); !context.Truthy() {
t.Fatal("getContext('webgl') failed")
}
}
> & (Get-Process -Id $PID).Path { $env:GOOS="js"; $env:GOARCh="wasm"; go test -exec="\\Mac\Home\ebiten\wasmbrowsertest.exe" .\examples\test\ }
--- FAIL: TestWebGL (0.00s)
main_test.go:18: getContext('webgl') failed
FAIL
exit with status 1
FAIL github.com/hajimehoshi/ebiten/v2/examples/test 1.130s
FAIL
from wasmbrowsertest.
Ok, so it's a chromedp thing: chromedp/chromedp#1190. I'll take a deeper look.
from wasmbrowsertest.
Related Issues (20)
- Run examples HOT 12
- wasmbrowsertest taking too long and not printing any output HOT 39
- "panic: newosproc: not implemented" when executing in travis HOT 1
- `could not dial` errors on the latest Chrome on GitHub Actions HOT 4
- Support -shuffle flag HOT 1
- Accept permission HOT 2
- please enable discussions on this repo HOT 4
- Is there an example dockerfile? HOT 1
- goroutine support HOT 14
- Error: command line too long HOT 6
- cross browser testing HOT 5
- using -- to signify end of options HOT 8
- `total length of command line and environment variables exceeds limit` in GitHub Actions HOT 27
- error generating coverage report HOT 7
- A way to test WASM aims to be run in the web worker HOT 10
- update documentation regarding go 1.20 coverage tools HOT 3
- Is there away to click "OK" on an alert window? HOT 2
- Flaky test TestRun/panic_fails in Windows HOT 3
- Tests flake when a callback is called after the test finishes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmbrowsertest.