summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js')
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js
new file mode 100644
index 000000000..b41d9884b
--- /dev/null
+++ b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js
@@ -0,0 +1,45 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+
+add_task(function*() {
+ // Note that head_autocomplete.js has already added a MozSearch engine.
+ // Here we add another engine with a search alias.
+ Services.search.addEngineWithDetails("AliasedMozSearch", "", "doit", "",
+ "GET", "http://s.example.com/search");
+
+ do_print("search engine");
+ yield check_autocomplete({
+ search: "mozilla",
+ searchParam: "enable-actions",
+ matches: [ makeSearchMatch("mozilla", { heuristic: true }) ]
+ });
+
+ do_print("search engine, uri-like input");
+ yield check_autocomplete({
+ search: "http:///",
+ searchParam: "enable-actions",
+ matches: [ makeSearchMatch("http:///", { heuristic: true }) ]
+ });
+
+ do_print("search engine, multiple words");
+ yield check_autocomplete({
+ search: "mozzarella cheese",
+ searchParam: "enable-actions",
+ matches: [ makeSearchMatch("mozzarella cheese", { heuristic: true }) ]
+ });
+
+ do_print("search engine, after current engine has changed");
+ Services.search.addEngineWithDetails("MozSearch2", "", "", "", "GET",
+ "http://s.example.com/search2");
+ engine = Services.search.getEngineByName("MozSearch2");
+ notEqual(Services.search.currentEngine, engine, "New engine shouldn't be the current engine yet");
+ Services.search.currentEngine = engine;
+ yield check_autocomplete({
+ search: "mozilla",
+ searchParam: "enable-actions",
+ matches: [ makeSearchMatch("mozilla", { engineName: "MozSearch2", heuristic: true }) ]
+ });
+
+ yield cleanup();
+});