| Index: chrome/test/data/android/webvr_instrumentation/resources/webvr_e2e.js
|
| diff --git a/chrome/test/data/android/webvr_instrumentation/resources/webvr_e2e.js b/chrome/test/data/android/webvr_instrumentation/resources/webvr_e2e.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e04500338fe0d7a8e2bf40a9a728ef45022713df
|
| --- /dev/null
|
| +++ b/chrome/test/data/android/webvr_instrumentation/resources/webvr_e2e.js
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +var testPassed = false;
|
| +var resultString = "";
|
| +var asyncCounter = 0;
|
| +var javascriptDone = false;
|
| +var vrDisplayPromiseDone = false;
|
| +
|
| +function finishJavascriptStep() {
|
| + javascriptDone = true;
|
| +}
|
| +
|
| +function checkResultsForFailures(tests, harness_status) {
|
| + testPassed = true;
|
| + if (harness_status["status"] != 0) {
|
| + testPassed = false;
|
| + resultString += "Harness failed due to " +
|
| + (harness_status["status"] == 1 ? "error" : "timeout")
|
| + + ". ";
|
| + }
|
| + for (var test in tests) {
|
| + let passed = (tests[test]["status"] == 0);
|
| + if (!passed) {
|
| + testPassed = false;
|
| + resultString += "FAIL ";
|
| + } else {
|
| + resultString += "PASS ";
|
| + }
|
| + resultString += tests[test]["name"] +
|
| + (passed ? "" : (": " + tests[test]["message"])) +
|
| + ". ";
|
| + }
|
| +}
|
| +
|
| +add_completion_callback( (tests, harness_status) => {
|
| + checkResultsForFailures(tests, harness_status);
|
| + console.debug("Test result: " + (testPassed ? "Pass" : "Fail"));
|
| + console.debug("Test result string: " + resultString);
|
| + finishJavascriptStep();
|
| +});
|
|
|