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

Side by Side Diff: chrome/test/data/android/webvr_instrumentation/resources/webvr_e2e.js

Issue 2588703003: Add WebVR WebVR E2E test capabilities via Android instrumentation (Closed)
Patch Set: Simplify Javascript code slightly Created 3 years, 10 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 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var testPassed = false;
6 var resultString = "";
7 var asyncCounter = 0;
8 var javascriptDone = false;
9 var vrDisplayPromiseDone = false;
10
11 function finishJavascriptStep() {
12 javascriptDone = true;
13 }
14
15 function checkResultsForFailures(tests, harness_status) {
16 testPassed = true;
17 if (harness_status["status"] != 0) {
18 testPassed = false;
19 resultString += "Harness failed due to " +
20 (harness_status["status"] == 1 ? "error" : "timeout")
21 + ". ";
22 }
23 for (var test in tests) {
24 let passed = (tests[test]["status"] == 0);
25 if (!passed) {
26 testPassed = false;
27 resultString += "FAIL ";
28 } else {
29 resultString += "PASS ";
30 }
31 resultString += tests[test]["name"] +
32 (passed ? "" : (": " + tests[test]["message"])) +
33 ". ";
Lei Lei 2017/02/16 22:04:50 How about setting resultString to JSON.stringify(t
bsheedy 2017/02/16 23:30:14 I feel like that ends up being too verbose. For a
Lei Lei 2017/02/17 00:18:14 It is fine to keep it short, what is the message i
bsheedy 2017/02/17 17:58:10 An example of a test failing when reaching an asse
34 }
35 }
36
37 add_completion_callback( (tests, harness_status) => {
38 checkResultsForFailures(tests, harness_status);
39 console.debug("Test result: " + (testPassed ? "Pass" : "Fail"));
40 console.debug("Test result string: " + resultString);
41 finishJavascriptStep();
42 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698