Bug 102663 - Add a test case for pressing space when an image map is focused; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 18 Apr 2015 18:52:32 -0400
changeset 259363 23ed444769a8431ba08e07f271a3bf06044290c9
parent 259362 183d3acaef74aa353aed6cc2078627184a35a524
child 259364 dc6d37458b88dfcd3ada37248f40c6459d9ebf84
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs102663
milestone40.0a1
Bug 102663 - Add a test case for pressing space when an image map is focused; r=roc
editor/libeditor/tests/file_bug915962.html
editor/libeditor/tests/test_bug915962.html
--- a/editor/libeditor/tests/file_bug915962.html
+++ b/editor/libeditor/tests/file_bug915962.html
@@ -1,7 +1,13 @@
 <!DOCTYPE html>
 <html>
   <body>
     <button>Button</button>
+    <img src="green.png" usemap="#map">
+    <map name="map">
+      <!-- This URL ensures that the link doesn't get clicked, since
+           mochitests cannot access the outside network. -->
+      <area shape="rect" coords="0,0,10,10" href="https://youtube.com/">
+    </map>
     <div style="height: 20000px;" tabindex="-1"><hr></div>
   </body>
 </html>
--- a/editor/libeditor/tests/test_bug915962.html
+++ b/editor/libeditor/tests/test_bug915962.html
@@ -58,16 +58,26 @@ function startTest() {
   button.onclick = () => clicked = true;
   oldY = win.scrollY;
   synthesizeKey(" ", {}, win);
 
   step();
 
   ok(win.scrollY <= oldY, "Page is not scrolled down");
   ok(clicked, "The button should be clicked");
+  synthesizeKey("VK_TAB", {}, win);
+
+  step();
+
+  oldY = win.scrollY;
+  synthesizeKey(" ", {}, win);
+
+  step()
+
+  ok(win.scrollY >= oldY, "Page is scrolled down");
 
   win.close();
   cwu.restoreNormalRefresh();
 
   win = window.open("file_bug915962.html", "_blank",
                     "width=600,height=600,scrollbars=yes");
   cwu = SpecialPowers.getDOMWindowUtils(win);
   SimpleTest.waitForFocus(function() {