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

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

Issue 2768583002: Make VR screen tap tests more stable (Closed)
Patch Set: Move VR test library behind flag Created 3 years, 8 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
« no previous file with comments | « chrome/test/data/android/webvr_instrumentation/html/test_screen_taps_not_registered_on_daydream.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 screen taps are registered while in VR when viewer is
4 Cardboard 4 Cardboard
5 --> 5 -->
6 <html> 6 <html>
7 <head> 7 <head>
8 <link rel="stylesheet" type="text/css" href="../resources/webvr_e2e.css"> 8 <link rel="stylesheet" type="text/css" href="../resources/webvr_e2e.css">
9 </head> 9 </head>
10 <body> 10 <body>
11 <canvas id="webgl-canvas"></canvas> 11 <canvas id="webgl-canvas"></canvas>
12 <script src="../../../../../../third_party/WebKit/LayoutTests/resources/test harness.js"></script> 12 <script src="../../../../../../third_party/WebKit/LayoutTests/resources/test harness.js"></script>
13 <script src="../resources/webvr_e2e.js"></script> 13 <script src="../resources/webvr_e2e.js"></script>
14 <script src="../resources/webvr_boilerplate.js"></script> 14 <script src="../resources/webvr_boilerplate.js"></script>
15 <script> 15 <script>
16 var t = async_test("Screen taps registered when in VR w/ Cardboard"); 16 var t = async_test("Screen taps registered when in VR w/ Cardboard");
17 window.addEventListener("vrdisplaypresentchange", 17 window.addEventListener("vrdisplaypresentchange",
18 () => {finishJavascriptStep();}, false); 18 () => {finishJavascriptStep();}, false);
19 var numTaps = 0; 19 var numTaps = 0;
20 webglCanvas.addEventListener("click", () => {numTaps++;}, false); 20 webglCanvas.addEventListener("click",
21 () => {
22 numTaps++;
23 // Notify Java when we've received the tap after entering VR
24 if (numTaps == 2) {
25 t.done();
26 }
27 }, false);
21 28
22 function stepVerifyNoInitialTaps() { 29 function stepVerifyNoInitialTaps() {
23 t.step( () => { 30 t.step( () => {
24 assert_equals(numTaps, 0, "No initial taps"); 31 assert_equals(numTaps, 0, "No initial taps");
25 }); 32 });
26 finishJavascriptStep(); 33 finishJavascriptStep();
27 } 34 }
28
29 function stepVerifyAdditionalTap() {
30 t.step_func_done( () => {
31 // We expect 1 tap from entering VR + 1 additional one after
32 assert_equals(numTaps, 2,
33 "Two taps registered after two taps given");
34 })();
35 }
36
37 </script> 35 </script>
38 </body> 36 </body>
39 </html> 37 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/android/webvr_instrumentation/html/test_screen_taps_not_registered_on_daydream.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698