mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 00:08:59 +00:00
Fix the Screen and ScreenOrientation prototype
This commit is contained in:
20
src/tests/html/screen.html
Normal file
20
src/tests/html/screen.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<script src="../testing.js"></script>
|
||||
|
||||
<script id=screen>
|
||||
let screen = window.screen;
|
||||
testing.expectEqual(1920, screen.width);
|
||||
testing.expectEqual(1080, screen.height);
|
||||
|
||||
let orientation = screen.orientation;
|
||||
testing.expectEqual(0, orientation.angle);
|
||||
testing.expectEqual('landscape-primary', orientation.type);
|
||||
|
||||
// this shouldn't crash (it used to)
|
||||
screen.addEventListener('change', () => {});
|
||||
</script>
|
||||
|
||||
<script id=orientation>
|
||||
screen.orientation.addEventListener('change', () => {})
|
||||
// above shouldn't crash (it used to)
|
||||
testing.skip();
|
||||
</script>
|
||||
Reference in New Issue
Block a user