Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 }); | |
| OLD | NEW |