Bug 1228111 - Tests that keywords in Address Bar can be prefixed by spaces. r=adw
MozReview-Commit-ID: Ej2U0insKZT
--- a/toolkit/components/places/tests/unifiedcomplete/test_keyword_search.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_keyword_search.js
@@ -64,10 +64,16 @@ add_task(async function test_keyword_sea
});
info("Keyword without query (with space)");
await check_autocomplete({
search: "key ",
matches: [ { uri: NetUtil.newURI("http://abc/?search="), title: "abc", style: ["keyword", "heuristic"] } ]
});
+ info("Bug 1228111 - Keyword with a space in front");
+ await check_autocomplete({
+ search: " key test",
+ matches: [ { uri: NetUtil.newURI("http://abc/?search=test"), title: "abc", style: ["keyword", "heuristic"] } ]
+ });
+
await cleanup();
});
--- a/toolkit/components/places/tests/unifiedcomplete/test_keyword_search_actions.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_keyword_search_actions.js
@@ -140,10 +140,18 @@ add_task(async function test_keyword_sea
info("Bug 359809: escaping +, / and @ with forced ISO-8859-1 charset");
await check_autocomplete({
search: "charset +/@",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=%2B%2F%40&raw=+/@", input: "charset +/@" }),
title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
});
+ info("Bug 1228111 - Keyword with a space in front");
+ await check_autocomplete({
+ search: " key test",
+ searchParam: "enable-actions",
+ matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=test", input: " key test" }),
+ title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
+ });
+
await cleanup();
});