Closed Bug 573740 Opened 14 years ago Closed 14 years ago

Register resource://services-sync before xpcshell tests get run

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Mardak, Assigned: philikon)

References

Details

Attachments

(2 files)

Seems like app-startup notification isn't sent.. or is sent after the xpcshell test tries to run.

We'll have to add the resource earlier.. maybe in the Weave.js's WeaveService constructor.

Or register it from the test head_
Attached patch v1Splinter Review
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #453161 - Flags: review?(mconnor)
Flags: blocking-fx-sync1.4+
Attachment #453161 - Flags: review?(mconnor) → review+
http://hg.mozilla.org/services/fx-sync/rev/94d14dc51035
Add the alias to resource://services-sync when loading the component instead of waiting for app-startup, which doesn't fire for xpcshell tests.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4
Comment on attachment 453161 [details] [diff] [review]
v1

>+(function addResourceAlias() {
>+  let ioService = Cc["@mozilla.org/network/io-service;1"].
>+                  getService(Ci.nsIIOService);
>+  let resProt = ioService.getProtocolHandler("resource").
>+                QueryInterface(Ci.nsIResProtocolHandler);
>+
>+  // Only create alias if resource://services-sync doesn't already exist.
>+  if (resProt.hasSubstitution("services-sync"))
>+    return;

While fixing the test issue on the trunk, this patch causes problems for the add-on case: the aliasing now happens when the top scope of Weave.js is executed. This apparently happens *before* the add-on's chrome.manifest is registered so the above if never triggers on the add-on.

I suggest backing this out and doing the aliasing separately for the tests.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch Fix add-on caseSplinter Review
Put the call to addResourceAlias() back into the app-startup observer, but expose addResourceAlias() to other JS contexts so we can call it from xpcshell tests.
Assignee: edilee → philipp
Attachment #453375 - Flags: review?(mconnor)
(In reply to comment #3)
> This apparently happens *before* the add-on's chrome.manifest is
> registered so the above if never triggers on the add-on.
Hrm. There must be a difference between cached manifests then. Seems like the add-on passes tests fine for existing profiles.
Attachment #453375 - Flags: review?(mconnor) → review+
http://hg.mozilla.org/services/fx-sync/rev/26b413905024
Don't try to create the alias too early, add-on chrome registration might not have happened yet, so do it during testing.
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: