Bug 1701950 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

In [head_search.js we currently have](https://searchfox.org/mozilla-central/rev/0e3d2eb698a51006943f3b4fb74c035da80aa2ff/toolkit/components/search/tests/xpcshell/head_search.js#263-316) `addTestEngines` and `installTestEngine`.

These can now be replaced [by the newer](https://searchfox.org/mozilla-central/rev/0e3d2eb698a51006943f3b4fb74c035da80aa2ff/toolkit/components/search/tests/SearchTestUtils.jsm#47-69) `SearchTestUtils.promiseNewSearchEngine()`.

Here are links to where these are currently used in tests: [addTestEngines](https://searchfox.org/mozilla-central/search?q=addTestEngines&path=search), [installTestEngine](https://searchfox.org/mozilla-central/search?q=addTestEngines&path=search).

The addObserver mechanism in `addTestEngines` is no longer required - `promiseNewSearchEngine` has the same effect overall, just simpler parameters.

You can run the tests after an initial build with `./mach xpcshell-test toolkit/components/search --tag=searchmain`. In this case the `--tag` avoids running some long duration configuration tests which aren't going to be affected by these changes.
In [head_search.js we currently have](https://searchfox.org/mozilla-central/rev/0e3d2eb698a51006943f3b4fb74c035da80aa2ff/toolkit/components/search/tests/xpcshell/head_search.js#263-316) `addTestEngines` and `installTestEngine`.

These can now be replaced [by the newer](https://searchfox.org/mozilla-central/rev/0e3d2eb698a51006943f3b4fb74c035da80aa2ff/toolkit/components/search/tests/SearchTestUtils.jsm#47-69) `SearchTestUtils.promiseNewSearchEngine()`.

Here are links to where these are currently used in tests: [addTestEngines](https://searchfox.org/mozilla-central/search?q=addTestEngines&path=search), [installTestEngine](https://searchfox.org/mozilla-central/search?q=installTestEngine&path=search&case=false&regexp=false).

The addObserver mechanism in `addTestEngines` is no longer required - `promiseNewSearchEngine` has the same effect overall, just simpler parameters.

You can run the tests after an initial build with `./mach xpcshell-test toolkit/components/search --tag=searchmain`. In this case the `--tag` avoids running some long duration configuration tests which aren't going to be affected by these changes.

Back to Bug 1701950 Comment 0