Permalink
Browse files

Update tests after issue 5594

  • Loading branch information...
1 parent d90124a commit 8b0eb322de80c805ac8459ce6593985c3f5c7789 @simonlindholm simonlindholm committed Jun 20, 2012
@@ -7,7 +7,7 @@
<script>
var obj = {
AbcD: 1,
- aBcde: 1
+ aBcdE: 1
};
</script>
</head>
@@ -23,9 +23,10 @@
<li>Verify the following completions by typing the prefix and pressing <span class="key">TAB</span>:</li>
<ul>
<li>"obj.A" <span class="ok">&rArr; "obj.AbcD"</span></li>
- <li>"obj.a" <span class="ok">&rArr; "obj.aBcde"</span></li>
+ <li>"obj.a" <span class="ok">&rArr; "obj.aBcdE"</span></li>
<li>"obj.AB" <span class="ok">&rArr; "obj.AB"</span></li>
- <li>"obj.ab" <span class="ok">&rArr; "obj.AbcD"</span></li>
+ <li>"obj.ab" <span class="ok">&rArr; "obj.aBdeE"</span></li>
+ <li>"obj.abx&lt;backspace&gt;" <span class="ok">&rArr; "obj.AbcD"</span></li>
<li>"obj.Abcd" <span class="ok">&rArr; "obj.AbcD"</span></li>
</ul>
<li>Verify that when typing " obj.ab", the completion text starts
@@ -36,6 +37,8 @@
<li>Case-insensitive matches should appear as completions.</li>
<li>Typed capital letters should force case at those points.</li>
<li>Completions that match case should be preferred as defaults.</li>
+ <li>When typing another letter, the completion should remain unless
+ another completion suddenly appears better at matching case.</li>
</ul>
</section>
<footer>
@@ -25,32 +25,39 @@ function runTest()
{
cmdLine.value = "";
FBTest.typeCommand(expr);
+ var desc = expr;
+ if (expr.slice(-1) === "x")
+ {
+ FBTest.synthesizeKey("VK_BACK_SPACE", null, win);
+ desc += "<backspace>";
+ }
FBTest.synthesizeKey("VK_TAB", null, win);
- FBTest.compare(wanted, cmdLine.value, "Completing \"" + expr + "\"\"" + wanted + "\"");
+ FBTest.compare(wanted, cmdLine.value, "Completing \"" + desc + "\"\"" + wanted + "\"");
callback();
}
function testVisibleCase(callback)
{
cmdLine.value = "";
FBTest.typeCommand(" obj.ab");
- FBTest.compare(" obj.abcD", completionBox.value,
+ FBTest.compare(" obj.abcdE", completionBox.value,
"Completion box should retain the exact prefix");
waitForOpen(function()
{
var el = popup.querySelector("div[selected=true]");
FBTest.ok(el, "The completion popup should open, with something selected");
- FBTest.compare(" obj.AbcD", el.textContent,
+ FBTest.compare(" obj.aBcdE", el.textContent,
"Completion popup should show the case of the completion");
callback();
});
}
var tests = [
["A", "AbcD"],
- ["a", "aBcde"],
+ ["a", "aBcdE"],
["AB", "AB"],
- ["ab", "AbcD"],
+ ["ab", "aBcdE"],
+ ["abx", "AbcD"],
["Abcd", "AbcD"]
];

0 comments on commit 8b0eb32

Please sign in to comment.