diff options
Diffstat (limited to 'devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_array_no_index.js')
-rw-r--r-- | devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_array_no_index.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_array_no_index.js b/devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_array_no_index.js new file mode 100644 index 0000000000..e880229b9d --- /dev/null +++ b/devtools/client/webconsole/test/browser/browser_jsterm_autocomplete_array_no_index.js @@ -0,0 +1,39 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// See Bug 585991. + +const TEST_URI = `data:text/html;charset=utf-8, +<!DOCTYPE html> +<head> + <script> + window.foo = [1,2,3]; + </script> +</head> +<body>bug 585991 - Autocomplete popup on array</body>`; + +add_task(async function () { + const hud = await openNewTabAndConsole(TEST_URI); + const { autocompletePopup: popup } = hud.jsterm; + + const onPopUpOpen = popup.once("popup-opened"); + + info("wait for popup to show"); + setInputValue(hud, "foo"); + EventUtils.sendString("."); + + await onPopUpOpen; + + ok( + !hasPopupLabel(popup, "0"), + "Completing on an array doesn't show numbers." + ); + + info("press Escape to close the popup"); + const onPopupClose = popup.once("popup-closed"); + EventUtils.synthesizeKey("KEY_Escape"); + + await onPopupClose; +}); |