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 240455 23ed444769a8431ba08e07f271a3bf06044290c9
parent 240454 183d3acaef74aa353aed6cc2078627184a35a524
child 240456 dc6d37458b88dfcd3ada37248f40c6459d9ebf84
push id28636
push userkwierso@gmail.com
push dateThu, 23 Apr 2015 00:16:12 +0000
treeherdermozilla-central@a5af73b32ac8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs102663
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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() {