Bug 1228111 - Tests that keywords in Address Bar can be prefixed by spaces. r=adw draft
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 18 Jan 2018 10:53:57 +0100
changeset 722013 dd7c0d8e1dcf45c7f414e141307858a6f4e097fd
parent 720380 b7d66e4e60ef177ec9ae687daa29443ae4a2acfc
child 746506 662e3e37600ac6f069a93f8c1aac9caf0d3e9655
push id96028
push usermak77@bonardo.net
push dateThu, 18 Jan 2018 09:56:38 +0000
reviewersadw
bugs1228111
milestone59.0a1
Bug 1228111 - Tests that keywords in Address Bar can be prefixed by spaces. r=adw MozReview-Commit-ID: Ej2U0insKZT
toolkit/components/places/tests/unifiedcomplete/test_keyword_search.js
toolkit/components/places/tests/unifiedcomplete/test_keyword_search_actions.js
--- 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();
 });