/* 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"; // Tests that CSS property names are autocompleted and cycled correctly when // editing an existing property in the rule view. // format : // [ // what key to press, // expected input box value after keypress, // is the popup open, // is a suggestion selected in the popup, // ] const OPEN = true, SELECTED = true; var testData = [ ["VK_RIGHT", "font", !OPEN, !SELECTED], ["-", "font-size", OPEN, SELECTED], ["f", "font-family", OPEN, SELECTED], ["VK_BACK_SPACE", "font-f", !OPEN, !SELECTED], ["VK_BACK_SPACE", "font-", !OPEN, !SELECTED], ["VK_BACK_SPACE", "font", !OPEN, !SELECTED], ["VK_BACK_SPACE", "fon", !OPEN, !SELECTED], ["VK_BACK_SPACE", "fo", !OPEN, !SELECTED], ["VK_BACK_SPACE", "f", !OPEN, !SELECTED], ["VK_BACK_SPACE", "", !OPEN, !SELECTED], ["d", "display", OPEN, SELECTED], ["VK_DOWN", "dominant-baseline", OPEN, SELECTED], ["VK_DOWN", "direction", OPEN, SELECTED], ["VK_DOWN", "display", OPEN, SELECTED], ["VK_UP", "direction", OPEN, SELECTED], ["VK_UP", "dominant-baseline", OPEN, SELECTED], ["VK_UP", "display", OPEN, SELECTED], ["VK_BACK_SPACE", "d", !OPEN, !SELECTED], ["i", "display", OPEN, SELECTED], ["s", "display", !OPEN, !SELECTED], ["VK_BACK_SPACE", "dis", !OPEN, !SELECTED], ["VK_BACK_SPACE", "di", !OPEN, !SELECTED], ["VK_BACK_SPACE", "d", !OPEN, !SELECTED], ["VK_BACK_SPACE", "", !OPEN, !SELECTED], ["VK_HOME", "", !OPEN, !SELECTED], ["VK_END", "", !OPEN, !SELECTED], ["VK_PAGE_UP", "", !OPEN, !SELECTED], ["VK_PAGE_DOWN", "", !OPEN, !SELECTED], ["d", "display", OPEN, SELECTED], ["VK_HOME", "display", !OPEN, !SELECTED], ["VK_END", "display", !OPEN, !SELECTED], // Press right key to ensure caret move to end of the input on Mac OS since // Mac OS doesn't move caret after pressing HOME / END. ["VK_RIGHT", "display", !OPEN, !SELECTED], ["VK_BACK_SPACE", "displa", !OPEN, !SELECTED], ["VK_BACK_SPACE", "displ", !OPEN, !SELECTED], ["VK_BACK_SPACE", "disp", !OPEN, !SELECTED], ["VK_BACK_SPACE", "dis", !OPEN, !SELECTED], ["VK_BACK_SPACE", "di", !OPEN, !SELECTED], ["VK_BACK_SPACE", "d", !OPEN, !SELECTED], ["VK_BACK_SPACE", "", !OPEN, !SELECTED], ["f", "font-size", OPEN, SELECTED], ["i", "filter", OPEN, SELECTED], ["VK_LEFT", "filter", !OPEN, !SELECTED], ["VK_LEFT", "filter", !OPEN, !SELECTED], ["i", "fiilter", !OPEN, !SELECTED], ["VK_ESCAPE", null, !OPEN, !SELECTED], ]; const TEST_URI = "