Closed Bug 566784 Opened 14 years ago Closed 14 years ago

Simple storage test fails when run by cfx testall

Categories

(Add-on SDK Graveyard :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Crap, a weird (but cool) thing the simple storage test does to get at its module's sandbox breaks when run via cfx testall.  With this patch all tests really pass, cfx text or cfx testall.  Is there a better way to do this?  Is there a way to generate resource URIs given a filename or file URI?
Attachment #446133 - Flags: review?(avarma)
confirmed fixes the failure for me.
Oh man! I should've seen this when code reviewing simple-storage, my bad.

So, one option for a cleaner solution is to add a method to cuddlefish.Loader objects called findSandboxForModule().  This would turn your code into something like this:

function manager(loader) {
  return loader.findSandboxForModule("simple-storage").globalScope.manager;
}

The method would be trivial for me to implement; what do you think?
Comment on attachment 446133 [details] [diff] [review]
patch

You can commit this for now if you want to solve the immediate problem of the busted tree, but I'd really like a solution that doesn't involve hard-coding these URLs, which is really an implementation detail that test suites shouldn't have to deal with (and dealing with them just makes them hella fragile).
Attachment #446133 - Flags: review?(avarma) → review-
(In reply to comment #2)
> The method would be trivial for me to implement; what do you think?

That sounds great Atul.
Blocks: 566904
Attachment #446133 - Attachment is obsolete: true
Attachment #446253 - Flags: review?(adw)
Comment on attachment 446253 [details] [diff] [review]
fix via new securablemodule.Loader.findSandboxForModule() method.

I know securable-module.js hasn't been code reviewed yet, but if you could just give this a quick look over it would be helpful.
Comment on attachment 446253 [details] [diff] [review]
fix via new securablemodule.Loader.findSandboxForModule() method.

Looks OK to me, and tests pass with it, thanks!
Attachment #446253 - Flags: review?(adw) → review+
Thanks! Pushed: http://hg.mozilla.org/labs/jetpack-sdk/rev/21537f905bf6
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: