Closed
Bug 783197
Opened 12 years ago
Closed 12 years ago
Ensure restoreDefaultEngines() completely resets the installed engines
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect, P2)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(firefox16 fixed, firefox17 fixed, firefox18 fixed, firefox19 fixed, firefox-esr10 fixed, firefox-esr17 fixed)
People
(Reporter: vladmaniac, Assigned: AndreeaMatei)
References
()
Details
(Whiteboard: [lib] s=121015 u=enhance c=search p=1)
Attachments
(1 file, 4 obsolete files)
1.57 KB,
patch
|
whimboo
:
review+
whimboo
:
checkin+
|
Details | Diff | Splinter Review |
Mozmill: 1.5.17 Platform: All Error: "An engine with that name already exists!" Failing method: setupModule: testSearchViaShortcut.js::setupModule Report crowd: http://mozmill-crowd.blargon7.com/#/functional/report/d87d47fd1034f072b9bece6ee644d4dc Report ci: http://mozmill-ci.blargon7.com/#/functional/report/d87d47fd1034f072b9bece6ee6402324 This would have to be fixed in restoreDefaultEngines, as https://bugzilla.mozilla.org/show_bug.cgi?id=780892#c8 clarifies.
Reporter | ||
Updated•12 years ago
|
Whiteboard: [mozmill-test-failure][functional]
Reporter | ||
Updated•12 years ago
|
Blocks: 780892
status-firefox-esr10:
--- → affected
status-firefox14:
--- → affected
status-firefox15:
--- → affected
status-firefox16:
--- → affected
status-firefox17:
--- → affected
Comment 1•12 years ago
|
||
The affecting patch has not landed yet, so please do not file test failures against non-existing failures. You could reference the local failure but the summary should clearly state what we have to do. And that's the restoreDefaultEngines() method.
Summary: Mozmill test failure /testSearch/testSearchViaShortcut.js | "An engine with that name already exists! " → Ensure restoreDefaultEngines() completely resets the installed engines
Whiteboard: [mozmill-test-failure][functional] → [lib]
Updated•12 years ago
|
Priority: -- → P2
Whiteboard: [lib] → [lib] s=2012-8-27 u=failure c=search p=1
Comment 2•12 years ago
|
||
I drop this from this weeks sprint. Instead we have to fix bug 790218.
Whiteboard: [lib] s=2012-8-27 u=failure c=search p=1 → [lib]
Updated•12 years ago
|
Whiteboard: [lib] → [lib] s=q3 u=enhance c=search p=1
Updated•12 years ago
|
Whiteboard: [lib] s=q3 u=enhance c=search p=1 → [lib] s=121015 u=enhance c=search p=1
Reporter | ||
Comment 3•12 years ago
|
||
We hereby wrongly assumed that restoreDefaultEngines will also delete the newly added engines, but it does not do that by design. It only restores the order in the engine list. You can easily check this manually. Therefore, its no job for this method to delete the additionally installed engines. This bug is invalid and if we want to fix bug 780892 we should simply make usage of removeEngine(aName) method from our shared modules and then call restoreDefaultEngines and this will work (tested it).
Comment 4•12 years ago
|
||
You are making wrong assumptions. This bug is about the addition of code which removes those installed engines by this helper method in search.js.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → vlad.mozbugs
Status: NEW → ASSIGNED
Assignee | ||
Updated•12 years ago
|
Assignee: vlad.mozbugs → andreea.matei
Assignee | ||
Comment 5•12 years ago
|
||
We now take on defaults the list of default engines and then check in the whole list of engines, those that are not default to remove them.
Attachment #678254 -
Flags: review?(hskupin)
Attachment #678254 -
Flags: review?(dave.hunt)
Comment 6•12 years ago
|
||
Comment on attachment 678254 [details] [diff] [review] patch v1 Review of attachment 678254 [details] [diff] [review]: ----------------------------------------------------------------- ::: lib/search.js @@ +796,5 @@ > { > + // Get the default engines list > + var defaults = this._bss.getDefaultEngines({ }).map(function (e) e.name); > + > + this.openEngineManager(function (controller) { I do not want to have ui related actions in this method. Those can fail and we will not be able to restore to the default engines. What we should do is to use the backend API to retrieve all installed engines and remove those which are not default ones.
Attachment #678254 -
Flags: review?(hskupin)
Attachment #678254 -
Flags: review?(dave.hunt)
Attachment #678254 -
Flags: review-
Assignee | ||
Comment 7•12 years ago
|
||
Updated so we won't use UI.
Attachment #678254 -
Attachment is obsolete: true
Attachment #678747 -
Flags: review?(hskupin)
Attachment #678747 -
Flags: review?(dave.hunt)
Comment 8•12 years ago
|
||
Comment on attachment 678747 [details] [diff] [review] patch v2 Review of attachment 678747 [details] [diff] [review]: ----------------------------------------------------------------- Does this leave the engines in the default sort order too? From what I understand we will either need to move the engines into the default order, or click the restore defaults button as we were doing before. ::: lib/search.js @@ +793,5 @@ > * Restore the default set of search engines (API call) > */ > + restoreDefaultEngines : function searchBar_restoreDefaults() { > + // Get the default and installed engines list > + var defaults = this._bss.getDefaultEngines({ }).map(function (e) e.name), Why are we initiating all of these variables in one go? It at least makes it hard to read. @@ +801,3 @@ > > + // Remove installed engines that are not default > + for (i = installedEnginesMaximumIndex; i >= 0; i--) { Can we use installedEngines.forEach here?
Attachment #678747 -
Flags: review?(hskupin)
Attachment #678747 -
Flags: review?(dave.hunt)
Attachment #678747 -
Flags: review-
Assignee | ||
Comment 9•12 years ago
|
||
Updated the variables and to use waitFor. The defaults order is correct.
Attachment #678747 -
Attachment is obsolete: true
Attachment #679122 -
Flags: review?(hskupin)
Attachment #679122 -
Flags: review?(dave.hunt)
Assignee | ||
Comment 10•12 years ago
|
||
Sorry, I meant to use forEach.
Comment 11•12 years ago
|
||
Comment on attachment 679122 [details] [diff] [review] patch v2.1 Review of attachment 679122 [details] [diff] [review]: ----------------------------------------------------------------- I can confirm that this does not restore the default order. You can also verify using tests/functional/testSearch/testReorderSearchEngines.js
Attachment #679122 -
Flags: review?(hskupin)
Attachment #679122 -
Flags: review?(dave.hunt)
Attachment #679122 -
Flags: review-
Assignee | ||
Comment 12•12 years ago
|
||
Reorder through the button as before, the other option being to move the engines as Dave said, but that's also using the method from engine manager.
Attachment #679632 -
Flags: review?(hskupin)
Attachment #679632 -
Flags: review?(dave.hunt)
Comment 13•12 years ago
|
||
Comment on attachment 679632 [details] [diff] [review] patch v3 Review of attachment 679632 [details] [diff] [review]: ----------------------------------------------------------------- Much better! I like that. Just a couple of nits left. ::: lib/search.js @@ +794,5 @@ > */ > + restoreDefaultEngines : function searchBar_restoreDefaults() { > + // Get the default and installed engines list > + var defaults = this._bss.getDefaultEngines({ }).map(function (e) e.name); > + var installedEngines = this._bss.getEngines({ }).map(function (e) e.name); Can you replace 'e' with 'engine'? @@ +795,5 @@ > + restoreDefaultEngines : function searchBar_restoreDefaults() { > + // Get the default and installed engines list > + var defaults = this._bss.getDefaultEngines({ }).map(function (e) e.name); > + var installedEngines = this._bss.getEngines({ }).map(function (e) e.name); > + var searchBar = this; Instead of searchBar please use 'self'. @@ +799,5 @@ > + var searchBar = this; > + > + // Remove installed engines that are not default > + installedEngines.forEach(function (engine) { > + if (defaults.toString().indexOf(engine) === -1) Don't use toString() here. indexOf is also available for arrays.
Attachment #679632 -
Flags: review?(hskupin)
Attachment #679632 -
Flags: review?(dave.hunt)
Attachment #679632 -
Flags: review-
Updated•12 years ago
|
status-firefox14:
affected → ---
status-firefox15:
affected → ---
status-firefox18:
--- → affected
status-firefox19:
--- → affected
Updated•12 years ago
|
status-firefox-esr17:
--- → affected
Assignee | ||
Comment 14•12 years ago
|
||
Thanks Henrik! Here are the requested changes.
Attachment #679122 -
Attachment is obsolete: true
Attachment #679632 -
Attachment is obsolete: true
Attachment #680026 -
Flags: review?(hskupin)
Attachment #680026 -
Flags: review?(dave.hunt)
Comment 15•12 years ago
|
||
Comment on attachment 680026 [details] [diff] [review] patch v3.1 Review of attachment 680026 [details] [diff] [review]: ----------------------------------------------------------------- http://hg.mozilla.org/qa/mozmill-tests/rev/0aa3cdeb140e (default)
Attachment #680026 -
Flags: review?(hskupin)
Attachment #680026 -
Flags: review?(dave.hunt)
Attachment #680026 -
Flags: review+
Attachment #680026 -
Flags: checkin+
Updated•12 years ago
|
Assignee | ||
Comment 16•12 years ago
|
||
This applies cleanly to all other branches.
Comment 17•12 years ago
|
||
http://hg.mozilla.org/qa/mozmill-tests/rev/2b3ec796902a (aurora) http://hg.mozilla.org/qa/mozmill-tests/rev/f1d7fb826dbc (beta) http://hg.mozilla.org/qa/mozmill-tests/rev/2c40b7499603 (release) http://hg.mozilla.org/qa/mozmill-tests/rev/a951812cc96a (esr17) http://hg.mozilla.org/qa/mozmill-tests/rev/6d46bd63b02a (esr10)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•