Bug 1229481 - Part 1: Move VR mochitest to its subfolder draft
authorDaosheng Mu <daoshengmu@gmail.com>
Thu, 04 May 2017 12:31:51 +0800
changeset 574177 db8d004d17d13a86042d45af7fed130e5100ca18
parent 572162 b25ad0674afd563e888dc07981baa626e8d794db
child 574178 5fe906d018a97edd36ee0c4955c294bd0f5bce7c
push id57594
push userbmo:dmu@mozilla.com
push dateMon, 08 May 2017 11:11:54 +0000
bugs1229481
milestone55.0a1
Bug 1229481 - Part 1: Move VR mochitest to its subfolder MozReview-Commit-ID: IK9f7aepBgw
dom/vr/moz.build
dom/vr/test/VRSimulationDriver.js
dom/vr/test/WebVRHelpers.js
dom/vr/test/mochitest.ini
dom/vr/test/mochitest/VRSimulationDriver.js
dom/vr/test/mochitest/WebVRHelpers.js
dom/vr/test/mochitest/mochitest.ini
dom/vr/test/mochitest/requestPresent.js
dom/vr/test/mochitest/runVRTest.js
dom/vr/test/mochitest/test_vrDisplay_canvas2d.html
dom/vr/test/mochitest/test_vrDisplay_exitPresent.html
dom/vr/test/mochitest/test_vrDisplay_getFrameData.html
dom/vr/test/mochitest/test_vrDisplay_onvrdisplaydeactivate_crosscontent.html
dom/vr/test/mochitest/test_vrDisplay_requestPresent.html
dom/vr/test/requestPresent.js
dom/vr/test/runVRTest.js
dom/vr/test/test_vrDisplay_canvas2d.html
dom/vr/test/test_vrDisplay_exitPresent.html
dom/vr/test/test_vrDisplay_getFrameData.html
dom/vr/test/test_vrDisplay_onvrdisplaydeactivate_crosscontent.html
dom/vr/test/test_vrDisplay_requestPresent.html
--- a/dom/vr/moz.build
+++ b/dom/vr/moz.build
@@ -23,9 +23,9 @@ UNIFIED_SOURCES = [
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/dom/base'
 ]
 
-MOCHITEST_MANIFESTS += ['test/mochitest.ini']
\ No newline at end of file
+MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
\ No newline at end of file
rename from dom/vr/test/VRSimulationDriver.js
rename to dom/vr/test/mochitest/VRSimulationDriver.js
rename from dom/vr/test/WebVRHelpers.js
rename to dom/vr/test/mochitest/WebVRHelpers.js
rename from dom/vr/test/mochitest.ini
rename to dom/vr/test/mochitest/mochitest.ini
rename from dom/vr/test/requestPresent.js
rename to dom/vr/test/mochitest/requestPresent.js
rename from dom/vr/test/runVRTest.js
rename to dom/vr/test/mochitest/runVRTest.js
new file mode 100644
--- /dev/null
+++ b/dom/vr/test/mochitest/test_vrDisplay_canvas2d.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>VRDisplay Canvas2D</title>
+    <meta name="timeout" content="long"/>
+    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+    <script src="runVRTest.js"></script>
+  </head>
+  <body>
+    <script>
+      "use strict";
+      var vrDisplay;
+
+      function requestPresentTest() {
+        async_test(function (test) {
+          vrDisplay.requestAnimationFrame(callback);
+
+          function callback() {
+            vrDisplay.resetPose();
+            vrDisplay.getLayers();
+            vrDisplay.submitFrame();
+            vrDisplay.getEyeParameters("right");
+            test.done();
+          }
+        }, "Finish WebVR Canvas2D requestPresentTest.");
+      }
+
+      function startTest() {
+        promise_test((test) => {
+          var canvas = document.createElement('canvas');
+          (document.body || document.documentElement).appendChild(canvas);
+          var context = canvas.getContext('2d');
+          var img = document.createElement('img');
+          img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACw=";
+
+          return navigator.getVRDisplays().then((displays) => {
+            assert_equals(displays.length, 1, "displays.length must be one after attach.");
+            vrDisplay = displays[0];
+            var frameData = new VRFrameData();
+            return vrDisplay.requestPresent([{source: canvas}]).then(() => {
+              requestPresentTest();
+            });
+          });
+        }, "Finish running WebVR Canvas2D test.");
+      }
+
+      runVRTest(startTest);
+    </script>
+  </body>
+</html>
\ No newline at end of file
rename from dom/vr/test/test_vrDisplay_exitPresent.html
rename to dom/vr/test/mochitest/test_vrDisplay_exitPresent.html
rename from dom/vr/test/test_vrDisplay_getFrameData.html
rename to dom/vr/test/mochitest/test_vrDisplay_getFrameData.html
rename from dom/vr/test/test_vrDisplay_onvrdisplaydeactivate_crosscontent.html
rename to dom/vr/test/mochitest/test_vrDisplay_onvrdisplaydeactivate_crosscontent.html
rename from dom/vr/test/test_vrDisplay_requestPresent.html
rename to dom/vr/test/mochitest/test_vrDisplay_requestPresent.html
deleted file mode 100644
--- a/dom/vr/test/test_vrDisplay_canvas2d.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>VRDisplay Canvas2D</title>
-    <meta name="timeout" content="long"/>
-    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-    <script src="runVRTest.js"></script>
-  </head>
-  <body>
-    <script>
-      var vrDisplay;
-
-      function requestPresentTest() {
-        async_test(function (test) {
-          vrDisplay.requestAnimationFrame(callback);
-
-          function callback() {
-            vrDisplay.resetPose();
-            vrDisplay.getLayers();
-            vrDisplay.submitFrame();
-            vrDisplay.getEyeParameters("right");
-            test.done();
-          }
-        }, "Finish WebVR Canvas2D requestPresentTest.");
-      }
-
-      function startTest() {
-        promise_test((test) => {
-          var canvas = document.createElement('canvas');
-          (document.body || document.documentElement).appendChild(canvas);
-          var context = canvas.getContext('2d');
-          var img = document.createElement('img');
-          img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACw=";
-
-          return navigator.getVRDisplays().then((displays) => {
-            assert_equals(displays.length, 1, "displays.length must be one after attach.");
-            vrDisplay = displays[0];
-            var frameData = new VRFrameData();
-            return vrDisplay.requestPresent([{source: canvas}]).then(() => {
-              requestPresentTest();
-            });
-          });
-        }, "Finish running WebVR Canvas2D test.");
-      }
-
-      runVRTest(startTest);
-    </script>
-  </body>
-</html>
\ No newline at end of file