Bug 819146 - Control/shift-enter in Metro urlbar is broken [r=ally]

This commit is contained in:
Matt Brubeck 2013-08-12 17:17:37 -07:00
parent 6f77ff1148
commit 60412c4f27
2 changed files with 47 additions and 1 deletions

View File

@ -471,7 +471,8 @@
]]>
</handler>
<handler event="keypress" phase="capturing" keycode="VK_RETURN">
<handler event="keypress" phase="capturing" keycode="VK_RETURN"
modifiers="accel shift any">
<![CDATA[
if (this.popup.submitSelected())
return;

View File

@ -154,6 +154,51 @@ gTests.push({
}
});
gTests.push({
desc: "Control-Enter in urlbar",
setUp: setUp,
tearDown: tearDown,
run: function () {
sendElementTap(window, gEdit);
ok(gEdit.isEditing, "focus urlbar: in editing mode");
EventUtils.sendString("example", window);
EventUtils.synthesizeKey("VK_RETURN", { accelKey: true }, window);
is(gEdit.value, "www.example.com", "Control-enter adds www. and .com");
ok(!gEdit.isEditing, "hit enter in urlbar: not in editing mode");
}
});
gTests.push({
desc: "Shift-Enter in urlbar",
setUp: setUp,
tearDown: tearDown,
run: function () {
sendElementTap(window, gEdit);
ok(gEdit.isEditing, "focus urlbar: in editing mode");
EventUtils.sendString("example", window);
EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true }, window);
is(gEdit.value, "www.example.net", "Shift-enter adds www. and .net");
ok(!gEdit.isEditing, "hit enter in urlbar: not in editing mode");
}
});
gTests.push({
desc: "Control-Shift-Enter in urlbar",
setUp: setUp,
tearDown: tearDown,
run: function () {
sendElementTap(window, gEdit);
ok(gEdit.isEditing, "focus urlbar: in editing mode");
EventUtils.sendString("example", window);
EventUtils.synthesizeKey("VK_RETURN", { accelKey: true, shiftKey: true }, window);
is(gEdit.value, "www.example.org", "Shift-enter adds www. and .org");
ok(!gEdit.isEditing, "hit enter in urlbar: not in editing mode");
}
});
gTests.push({
desc: "display and select a search with keyboard",
setUp: setUp,