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

Unified 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: Fix copyright header 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/android/webvr_instrumentation/resources/webvr_e2e.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+});
« no previous file with comments | « chrome/test/data/android/webvr_instrumentation/resources/webvr_e2e.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698