Closed Bug 570240 Opened 14 years ago Closed 14 years ago

need a way to open a new window (and convert tests to use it)

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dietrich, Assigned: dietrich)

References

Details

Attachments

(1 file)

see bug 570223. that approach to opening new browser windows isn't working on trunk anymore. we should use openDialog for now.

also, the code to open new browser windows is being duplicated across a bunch of tests.

i propose we expose openNewBrowserWindow(callback [, url]) off of the window-utils module, for both tests and other modules to use.
OS: Linux → All
Hardware: x86 → All
Blocks: 560467
No longer blocks: 560467
Attached patch v1Splinter Review
patch for impl. once reviewed, i'll update all the tests.
Assignee: nobody → dietrich
Attachment #449379 - Flags: review?(adw)
I see you've copied openBrowserWindow() from tab-browser.  tab-browser.addTab(), which is the only caller of openBrowserWindow, actually recognizes a |inNewWindow| option that forces the given URL to open in a new tab in a new window -- hence openBrowserWindow.  Could we just use that instead?
(In reply to comment #2)
> I see you've copied openBrowserWindow() from tab-browser. 
> tab-browser.addTab(), which is the only caller of openBrowserWindow, actually
> recognizes a |inNewWindow| option that forces the given URL to open in a new
> tab in a new window -- hence openBrowserWindow.  Could we just use that
> instead?


yeah, we could just convert all the tests to use addTab("about:blank"), so WONTFIXing this.

calling tab-browser.addTab when you want open a new window seems a little more awkward than window-utils.openBrowserWindow, but there's no public case for doing so atm, so not going to worry about it for now.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Might be worth defaulting to about:blank so you don't need to pass a URL if you don't care.
Attachment #449379 - Flags: review?(adw)
the addTab + inNewWindow approach doesn't provide a way to get access to the tab, nor the window. this means you can't do things like close the tab, or close the window.

that might be ok if there was a way to get access to the currently active window, but there's not.

i can cobble together everything i need to do these things in the traditional fully privileged xpcom way (assuming tests will always be priv'd), but i think that sooner or later we're going to need to make windows as easily accessible as the tabs module will do for tabs.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
i'm using chrome apis in all the tests, which is fine. we'll figure out a proper window api in bug 571449.

-> WONTFIX
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → WONTFIX
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: