diff -r 000000000000 -r 6474c204b198 browser/devtools/styleinspector/test/browser_ruleview_completion-existing-property_01.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/devtools/styleinspector/test/browser_ruleview_completion-existing-property_01.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,106 @@ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that CSS property names are autocompleted and cycled correctly when +// editing an existing property in the rule view + +const MAX_ENTRIES = 10; + +// format : +// [ +// what key to press, +// expected input box value after keypress, +// selectedIndex of the popup, +// total items in the popup +// ] +let testData = [ + ["VK_RIGHT", "border", -1, 0], + ["-","border-bottom", 0, 10], + ["b","border-bottom", 0, 6], + ["VK_BACK_SPACE", "border-b", -1, 0], + ["VK_BACK_SPACE", "border-", -1, 0], + ["VK_BACK_SPACE", "border", -1, 0], + ["VK_BACK_SPACE", "borde", -1, 0], + ["VK_BACK_SPACE", "bord", -1, 0], + ["VK_BACK_SPACE", "bor", -1, 0], + ["VK_BACK_SPACE", "bo", -1, 0], + ["VK_BACK_SPACE", "b", -1, 0], + ["VK_BACK_SPACE", "", -1, 0], + ["d", "direction", 0, 3], + ["VK_DOWN", "display", 1, 3], + ["VK_DOWN", "dominant-baseline", 2, 3], + ["VK_DOWN", "direction", 0, 3], + ["VK_DOWN", "display", 1, 3], + ["VK_UP", "direction", 0, 3], + ["VK_UP", "dominant-baseline", 2, 3], + ["VK_UP", "display", 1, 3], + ["VK_BACK_SPACE", "d", -1, 0], + ["i", "direction", 0, 2], + ["s", "display", -1, 0], + ["VK_BACK_SPACE", "dis", -1, 0], + ["VK_BACK_SPACE", "di", -1, 0], + ["VK_BACK_SPACE", "d", -1, 0], + ["VK_BACK_SPACE", "", -1, 0], + ["f", "fill", 0, MAX_ENTRIES], + ["i", "fill", 0, 4], + ["VK_LEFT", "fill", -1, 0], + ["VK_LEFT", "fill", -1, 0], + ["i", "fiill", -1, 0], + ["VK_ESCAPE", null, -1, 0], +]; + +let TEST_URL = "data:text/html,