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

Side by Side Diff: chrome/test/data/android/webvr_instrumentation/html/test_screen_taps_registered.html

Issue 2826273002: Add automated VR controller emulator (Closed)
Patch Set: New library version + proguard config Created 3 years, 7 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
1 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 Tests that screen taps are registered while in VR when viewer is 3 Tests that either screen taps are registered in VR when viewer is Cardboard
4 Cardboard 4 or that controller clicks are registered as screen taps in VR when viewer is
5 Daydream View.
5 --> 6 -->
6 <html> 7 <html>
7 <head> 8 <head>
8 <link rel="stylesheet" type="text/css" href="../resources/webvr_e2e.css"> 9 <link rel="stylesheet" type="text/css" href="../resources/webvr_e2e.css">
9 </head> 10 </head>
10 <body> 11 <body>
11 <canvas id="webgl-canvas"></canvas> 12 <canvas id="webgl-canvas"></canvas>
12 <script src="../../../../../../third_party/WebKit/LayoutTests/resources/test harness.js"></script> 13 <script src="../../../../../../third_party/WebKit/LayoutTests/resources/test harness.js"></script>
13 <script src="../resources/webvr_e2e.js"></script> 14 <script src="../resources/webvr_e2e.js"></script>
14 <script src="../resources/webvr_boilerplate.js"></script> 15 <script src="../resources/webvr_boilerplate.js"></script>
15 <script> 16 <script>
16 var t = async_test("Screen taps registered when in VR w/ Cardboard"); 17 var t = async_test("Screen taps/clicks registered when in VR");
17 window.addEventListener("vrdisplaypresentchange", 18 window.addEventListener("vrdisplaypresentchange",
18 () => {finishJavaScriptStep();}, false); 19 () => {finishJavaScriptStep();}, false);
19 var numTaps = 0; 20 var numTaps = 0;
20 webglCanvas.addEventListener("click", 21 webglCanvas.addEventListener("click",
21 () => { 22 () => {
22 numTaps++; 23 numTaps++;
23 // Notify Java when we've received the tap after entering VR 24 // Notify Java when we've received the tap after entering VR
24 if (numTaps == 2) { 25 if (numTaps == 2) {
25 t.done(); 26 t.done();
26 } 27 }
27 }, false); 28 }, false);
28 29
29 function stepVerifyNoInitialTaps() { 30 function stepVerifyNoInitialTaps() {
30 t.step( () => { 31 t.step( () => {
31 assert_equals(numTaps, 0, "No initial taps"); 32 assert_equals(numTaps, 0, "No initial taps");
32 }); 33 });
33 finishJavaScriptStep(); 34 finishJavaScriptStep();
34 } 35 }
35 </script> 36 </script>
36 </body> 37 </body>
37 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698