From d1d8aa6bda8cdfee5ac623217a82d7b86af76a04 Mon Sep 17 00:00:00 2001 From: Edward Lee Date: Thu, 17 Jul 2008 04:50:37 -0700 Subject: [PATCH] Bug 249468 - Add all bookmark keywords to location bar autocomplete drop-down list --- .../tests/autocomplete/test_keyword_search.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/toolkit/components/places/tests/autocomplete/test_keyword_search.js b/toolkit/components/places/tests/autocomplete/test_keyword_search.js index b9031e4bf7d3..e26bf11cb7b8 100644 --- a/toolkit/components/places/tests/autocomplete/test_keyword_search.js +++ b/toolkit/components/places/tests/autocomplete/test_keyword_search.js @@ -39,12 +39,18 @@ * sure that multiple parameter queries get spaces converted to +, + converted * to %2B, non-ascii become escaped, and pages in history that match the * keyword uses the page's title. + * + * Also test for bug 249468 by making sure multiple keyword bookmarks with the + * same keyword appear in the list. */ // Details for the keyword bookmark let keyBase = "http://abc/?search="; let keyKey = "key"; +// A second keyword bookmark with the same keyword +let otherBase = "http://xyz/?foo="; + let unescaped = "ユニコード"; let pageInHistory = "ThisPageIsInHistory"; @@ -56,6 +62,9 @@ let kURIs = [ keyBase + "blocking%2B", keyBase + unescaped, keyBase + pageInHistory, + otherBase + "%s", + keyBase + "twoKey", + otherBase + "twoKey", ]; let kTitles = [ "Generic page title", @@ -85,4 +94,14 @@ let gTests = [ keyKey + " " + unescaped, [4]], ["4: Keyword that happens to match a page", keyKey + " " + pageInHistory, [5]], + + // This adds a second keyword so anything after this will match 2 keywords + ["5: Two keywords matched", + keyKey + " twoKey", [7,8], + function() { + // Add the keyword search as well as search results + addPageBook(6, 0, 1, [], keyKey); + gPages[7] = [7,1]; + gPages[8] = [8,1]; + }], ];