Bug 1257366 - Try setting designMode again; r=gbrown
authorJim Chen <nchen@mozilla.com>
Wed, 22 Feb 2017 23:10:18 -0500
changeset 373490 bb5d3a227ee88805e1f5d555643eb500d444da55
parent 373489 4e3d73a1b3b4cf6c671602b70162ff32007b559a
child 373491 c34603e73ded3e732e3a9423ca3ba0e157775cd5
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1257366
milestone54.0a1
Bug 1257366 - Try setting designMode again; r=gbrown 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;