Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: third_party/WebKit/LayoutTests/vr/requestPresent_reject_NaN_bounds.html

Issue 2950233002: Validate untrusted VR mojo inputs into browser process (Closed)
Patch Set: add test and rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/fake-vr-displays.js"></script>
5 <script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></scr ipt>
6 <script src="file:///gen/device/vr/vr_service.mojom.js"></script>
7 <script src="resources/mock-vr-service.js"></script>
8 <canvas id="webgl-canvas"></canvas>
9 <script src="resources/presentation-setup.js"></script>
10 <script>
11 let fakeDisplays = fakeVRDisplays();
12
13 vr_test( (t) => {
14 return navigator.getVRDisplays().then( (displays) => {
15 var display = displays[0];
16
17 runWithUserGesture( () => {
18 display.requestPresent([{
19 source : webglCanvas,
20 leftBounds: [0, 0, 1, 1],
21 rightBounds: [NaN, NaN, NaN, NaN]
22 }])
23 .then( () => {
24 t.step( () => {
25 assert_unreached();
26 }, "Display should not be presenting");
27 }, (err) => {
28 t.step( () => {
29 assert_false(display.isPresenting);
30 }, "requestPresent rejected and not presenting");
31 }).then( () => {
32 t.done();
33 });
34 });
35 }, (err) => {
36 t.step( () => {
37 assert_unreached(err);
38 }, "getVRDisplays rejected");
39 t.done();
40 });
41 }, [fakeDisplays["Pixel"]],
42 "Test requestPresent rejects if provided a bad leftBounds");
43
44 </script>
45
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698