diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js b/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js new file mode 100644 index 0000000000..038bf33f8b --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_css_completion_style_attribute_03.js @@ -0,0 +1,52 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +/* import-globals-from helper_style_attr_test_runner.js */ + +"use strict"; + +// Test CSS autocompletion of the style attribute can be triggered when the +// caret is before a non-word character. + +loadHelperScript("helper_style_attr_test_runner.js"); + +const TEST_URL = URL_ROOT + "doc_markup_edit.html"; + +// test data format : +// [ +// what key to press, +// expected input box value after keypress, +// expected input.selectionStart, +// expected input.selectionEnd, +// is popup expected to be open ? +// ] +const TEST_DATA = [ + ["s", "s", 1, 1, false], + ["t", "st", 2, 2, false], + ["y", "sty", 3, 3, false], + ["l", "styl", 4, 4, false], + ["e", "style", 5, 5, false], + ["=", "style=", 6, 6, false], + ['"', 'style="', 7, 7, false], + ['"', 'style=""', 8, 8, false], + ["VK_LEFT", 'style=""', 7, 7, false], + ["c", 'style="color"', 8, 12, true], + ["o", 'style="color"', 9, 12, true], + ["VK_RIGHT", 'style="color"', 12, 12, false], + [":", 'style="color:aliceblue"', 13, 22, true], + ["b", 'style="color:beige"', 14, 18, true], + ["VK_RIGHT", 'style="color:beige"', 18, 18, false], + [";", 'style="color:beige;"', 19, 19, false], + [";", 'style="color:beige;;"', 20, 20, false], + ["VK_LEFT", 'style="color:beige;;"', 19, 19, false], + ["p", 'style="color:beige;padding;"', 20, 26, true], + ["VK_RIGHT", 'style="color:beige;padding;"', 26, 26, false], + [":", 'style="color:beige;padding:inherit;"', 27, 34, true], + ["0", 'style="color:beige;padding:0;"', 28, 28, false], + ["VK_RETURN", 'style="color:beige;padding:0;"', -1, -1, false], +]; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + + await runStyleAttributeAutocompleteTests(inspector, TEST_DATA); +}); |