Bug 1257366 - Try setting designMode again. r=gbrown, a=test-only
authorJim Chen <nchen@mozilla.com>
Wed, 22 Feb 2017 23:10:18 -0500
changeset 359401 716903f2bac83231d7f095fb32024cfa4a740f28
parent 359400 eb716d41e5b7b26a53030a2ba8d84de627379846
child 359402 b81da358001ae8b3510d759558efdad9cf011d76
push id10790
push userryanvm@gmail.com
push dateThu, 23 Feb 2017 15:02:50 +0000
treeherdermozilla-aurora@491f9e0666e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown, test-only
bugs1257366
milestone53.0a2
Bug 1257366 - Try setting designMode again. r=gbrown, a=test-only If the first set designMode call fails, schedule another call for a later time.
mobile/android/tests/browser/robocop/robocop_input.html
--- a/mobile/android/tests/browser/robocop/robocop_input.html
+++ b/mobile/android/tests/browser/robocop/robocop_input.html
@@ -14,17 +14,22 @@
     <p>Hiding input: <input id="hiding-input" type="text"></p>
     <script type="application/javascript;version=1.8" src="robocop_head.js"></script>
     <script type="application/javascript;version=1.8">
       let input = document.getElementById("input");
       let textArea = document.getElementById("text-area");
       let contentEditable = document.getElementById("content-editable");
 
       let designMode = document.getElementById("design-mode");
-      designMode.contentDocument.designMode = "on";
+      try {
+        designMode.contentDocument.designMode = "on";
+      } catch (e) {
+        // Setting designMode above sometimes fails, so try again later.
+        setTimeout(function() { designMode.contentDocument.designMode = "on" }, 0);
+      }
 
       // Spatial navigation interferes with design-mode key event tests.
       SpecialPowers.setBoolPref("snav.enabled", false);
 
       // An input that resets the editor on every input by resetting the value property.
       let resetting_input = document.getElementById("resetting-input");
       resetting_input.addEventListener('input', function() {
         this.value = this.value;