Last Comment Bug 678166 - Use the original CID for the mock object in mockObjects.js
: Use the original CID for the mock object in mockObjects.js
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla8
Assigned To: Mounir Lamouri (:mounir)
: Andrew Overholt [:overholt]
Depends on:
Blocks: 463491
  Show dependency treegraph
Reported: 2011-08-11 05:57 PDT by Mounir Lamouri (:mounir)
Modified: 2011-08-12 06:55 PDT (History)
1 user (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (4.03 KB, patch)
2011-08-11 05:57 PDT, Mounir Lamouri (:mounir)
ehsan: review+
Details | Diff | Splinter Review

Description User image Mounir Lamouri (:mounir) 2011-08-11 05:57:33 PDT
Created attachment 552348 [details] [diff] [review]
Patch v1

Trying to find what was happening with the test in bug 463491, I realized mockObjects.js was creating a new CID but Components.classes[contractId] was still pointing to the original CID making Components.classes[contractId].createInstance() to fail if the previous factory was removed.

For unknown reasons, in the current state of the file, it will work but the original factory isn't removed. The test in bug 463491 was failing because .unregisterFactory() was called and it seems that as soon as it's done, you can't use mockObjects.js for the same factory. IOW, launching two times in a row the same test was always failing. The same way, unregistering the original factory before registering the new one was making the test to always fail.

It goes without saying: this patch went to try and the tree is green.
Comment 1 User image Mounir Lamouri (:mounir) 2011-08-11 09:33:39 PDT
Thank you for the quick review!
Comment 2 User image Mounir Lamouri (:mounir) 2011-08-12 06:55:53 PDT

Note You need to log in before you can comment on or make changes to this bug.