From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../test/browser_inspector_search-label.js | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 devtools/client/inspector/test/browser_inspector_search-label.js (limited to 'devtools/client/inspector/test/browser_inspector_search-label.js') diff --git a/devtools/client/inspector/test/browser_inspector_search-label.js b/devtools/client/inspector/test/browser_inspector_search-label.js new file mode 100644 index 000000000..669ad79b8 --- /dev/null +++ b/devtools/client/inspector/test/browser_inspector_search-label.js @@ -0,0 +1,33 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +// Check that search label updated correctcly based on the search result. + +const TEST_URL = URL_ROOT + "doc_inspector_search.html"; + +add_task(function* () { + let { inspector } = yield openInspectorForURL(TEST_URL); + let { panelWin, searchResultsLabel } = inspector; + + info("Searching for test node #d1"); + // Expect the label shows 1 result + yield focusSearchBoxUsingShortcut(panelWin); + synthesizeKeys("#d1", panelWin); + EventUtils.synthesizeKey("VK_RETURN", {}, panelWin); + + yield inspector.search.once("search-result"); + is(searchResultsLabel.textContent, "1 of 1"); + + info("Click the clear button"); + // Expect the label is cleared after clicking the clear button. + + inspector.searchClearButton.click(); + is(searchResultsLabel.textContent, ""); + + // Catch-all event for remaining server requests when searching for the new + // node. + yield inspector.once("inspector-updated"); +}); -- cgit v1.2.3