Bug 1113206 followup - Add simple test for <select> elements in vertical writing mode. r=roc
authorJonathan Kew <jkew@mozilla.com>
Wed, 05 Aug 2015 12:43:24 +0100
changeset 287949 8a31c820b381e29e2db38a713e1c4bf421097976
parent 287948 0f4864d20e8cd84dcd3dd47a1c5840c7aecc0a39
child 287950 d44ecfd932525da059cc9b020e02e55c83ffe55b
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1113206
milestone42.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 1113206 followup - Add simple test for <select> elements in vertical writing mode. r=roc
layout/forms/test/mochitest.ini
layout/forms/test/test_select_vertical.html
--- a/layout/forms/test/mochitest.ini
+++ b/layout/forms/test/mochitest.ini
@@ -59,8 +59,10 @@ skip-if = (buildapp == 'b2g' && toolkit 
 skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || toolkit == 'android' #select elements don't use an in-page popup on Android # b2g-debug(select elements don't use an in-page popup in B2G) b2g-desktop(select elements don't use an in-page popup in B2G)
 [test_select_prevent_default.html]
 [test_textarea_resize.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' # b2g(resizing textarea not available in b2g) b2g-debug(resizing textarea not available in b2g) b2g-desktop(resizing textarea not available in b2g)
 [test_bug961363.html]
 skip-if = toolkit == 'android' # Bug 1021644 - Fails when pushed into a different chunk on Android
 [test_bug1111995.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g'
+[test_select_vertical.html]
+skip-if = e10s || buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' # Bug 1170129 - vertical <select> popup not implemented for e10s # <select> elements don't use an in-page popup on B2G/Android
new file mode 100644
--- /dev/null
+++ b/layout/forms/test/test_select_vertical.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test for select popup in vertical writing mode</title>
+<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+<script>
+SimpleTest.waitForExplicitFinish();
+
+function test() {
+  SimpleTest.waitForFocus(function() {
+    var vlr = document.getElementById("vlr");
+    var selWidth = vlr.offsetWidth;
+    var optWidth = vlr.children[0].offsetWidth;
+
+    // We should be able to choose options from the vertical-lr <select>
+    // at positions increasingly to the right of the element itself.
+    is(vlr.value, "1", "(vertical-lr) initial value should be 1");
+
+    synthesizeMouse(vlr, 5, 5, { type : "mousedown", button: 0 });
+    synthesizeMouse(vlr, selWidth + 1.5 * optWidth, 5, { type : "mouseup", button: 0 });
+
+    is(vlr.value, "2", "(vertical-lr) new value should be 2");
+
+    synthesizeMouse(vlr, 5, 5, { type : "mousedown", button: 0 });
+    synthesizeMouse(vlr, selWidth + 2.5 * optWidth, 5, { type : "mouseup", button: 0 });
+
+    is(vlr.value, "3", "(vertical-lr) new value should be 3");
+
+    synthesizeMouse(vlr, 5, 5, { type : "mousedown", button: 0 });
+    synthesizeMouse(vlr, selWidth + 0.5 * optWidth, 5, { type : "mouseup", button: 0 });
+
+    is(vlr.value, "1", "(vertical-lr) value should be back to 1");
+
+    var vrl = document.getElementById("vrl");
+
+    // We should be able to choose options from the vertical-rl <select>
+    // at positions increasingly to the left of the element itself.
+    is(vrl.value, "1", "(vertical-rl) initial value should be 1");
+
+    synthesizeMouse(vrl, 5, 5, { type : "mousedown", button: 0 });
+    synthesizeMouse(vrl, -1.5 * optWidth, 5, { type : "mouseup", button: 0 });
+
+    is(vrl.value, "2", "(vertical-rl) new value should be 2");
+
+    synthesizeMouse(vrl, 5, 5, { type : "mousedown", button: 0 });
+    synthesizeMouse(vrl, -2.5 * optWidth, 5, { type : "mouseup", button: 0 });
+
+    is(vrl.value, "3", "(vertical-rl) new value should be 3");
+
+    synthesizeMouse(vrl, 5, 5, { type : "mousedown", button: 0 });
+    synthesizeMouse(vrl, -0.5 * optWidth, 5, { type : "mouseup", button: 0 });
+
+    is(vrl.value, "1", "(vertical-rl) value should be back to 1");
+
+    SimpleTest.finish();
+  });
+}
+</script>
+
+<body onload="test();">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1113206">Mozilla Bug 1113206</a>
+<div>
+  <select id="vlr" style="writing-mode: vertical-lr; margin: 80px;">
+    <option value="1">one
+    <option value="2">two
+    <option value="3">three
+    <option value="4">four
+  </select>
+  <select id="vrl" style="writing-mode: vertical-rl; margin: 80px;">
+    <option value="1">one
+    <option value="2">two
+    <option value="3">three
+    <option value="4">four
+  </select>
+</div>