Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-filtering.html

Issue 2469153003: DevTools: Remove ghost text from FilteredListWidget (Closed)
Patch Set: Exit test on rejected promise Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-filtering.html
diff --git a/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-filtering.html b/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-filtering.html
deleted file mode 100644
index 6ec8ee340d0271d883b69359e0265bcc498db135..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector/filtered-item-selection-dialog-filtering.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<html>
-<head>
-<script src="../http/tests/inspector/inspector-test.js"></script>
-<script src="../http/tests/inspector/sources-test.js"></script>
-<script>
-
-function test()
-{
-
- var overridenInput = [];
- var overrideShowMatchingItems = true;
- var history = [];
-
- var StubDelegate = class extends WebInspector.FilteredListWidget.Delegate {
- constructor()
- {
- super(history);
- }
-
- itemKeyAt(itemIndex) { return overridenInput[itemIndex]; }
- itemScoreAt(itemIndex) { return 0; }
- itemCount() { return overridenInput.length; }
- selectItem(itemIndex, promptValue)
- {
- InspectorTest.addResult("Selected item index: " + itemIndex);
- }
- shouldShowMatchingItems() { return overrideShowMatchingItems; }
- };
-
- var delegate = new StubDelegate();
-
- function checkQuery(query, input, hideMatchingItems, acceptAutocomplete, next)
- {
- overridenInput = input;
- overrideShowMatchingItems = !hideMatchingItems;
-
- InspectorTest.addResult("Input:" + JSON.stringify(input));
-
- var filteredSelectionDialog = new WebInspector.FilteredListWidget(delegate);
- filteredSelectionDialog.showAsDialog();
- InspectorTest.addSniffer(filteredSelectionDialog, "_autocompletedForTests", onautocomplete);
- filteredSelectionDialog.setQuery(query);
- filteredSelectionDialog._updateAfterItemsLoaded();
-
- function onautocomplete()
- {
- if (acceptAutocomplete) {
- dump();
- InspectorTest.addSniffer(filteredSelectionDialog, "_autocompletedForTests", accept);
- filteredSelectionDialog._prompt.acceptAutoComplete();
- } else {
- accept();
- }
- }
-
- function dump()
- {
- InspectorTest.addResult("Query:" + JSON.stringify(filteredSelectionDialog._value()));
- var items = filteredSelectionDialog._filteredItems;
- var output = [];
- for (var i = 0; i < items.length; ++i)
- output.push(delegate.itemKeyAt(items[i]));
- InspectorTest.addResult("Output:" + JSON.stringify(output));
- InspectorTest.addResult("Completion:" + JSON.stringify(filteredSelectionDialog._prompt.textWithCurrentSuggestion()));
- }
-
- function accept()
- {
- dump();
- filteredSelectionDialog._onEnter(InspectorTest.createKeyEvent("Enter"));
- InspectorTest.addResult("History:" + JSON.stringify(history));
- next();
- }
- }
-
- InspectorTest.runTestSuite([
- function emptyQueryMatchesEverything(next)
- {
- checkQuery("", ["a", "bc"], false, false, next);
- },
-
- function caseSensitiveMatching(next)
- {
- checkQuery("aB", ["abc", "acB"], false, false, next);
- },
-
- function caseInsensitiveMatching(next)
- {
- checkQuery("ab", ["abc", "bac", "a_B"], false, false, next);
- },
-
- function dumplicateSymbolsInQuery(next)
- {
- checkQuery("aab", ["abab", "abaa", "caab", "baac", "fooaab"], false, false, next);
- },
-
- function dangerousInputEscaping(next)
- {
- checkQuery("^[]{}()\\.$*+?|", ["^[]{}()\\.$*+?|", "0123456789abcdef"], false, false, next);
- },
-
- function itemIndexIsNotReportedInGoToLine(next)
- {
- checkQuery(":1", [":1:2:3.js"], true, false, next);
- },
-
- function autoCompleteIsLast(next)
- {
- checkQuery("", ["abc", "abcd"], false, false, next);
- },
-
- function autoCompleteAccept(next)
- {
- checkQuery("a", ["abc", "abcd", "aabcd"], false, true, next);
- }
- ]);
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-Check to see that FilteredItemSelectionDialog uses proper regex to filter results.
-</p>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698