Open Bug 437063 Opened 16 years ago Updated 2 years ago

nsIDownloadManagerUI::visible isn't accurate

Categories

(Toolkit :: Downloads API, defect)

defect

Tracking

()

REOPENED

People

(Reporter: sdwilsh, Unassigned)

References

Details

(Keywords: dev-doc-needed, Whiteboard: [needs new patch])

Attachments

(1 file, 1 obsolete file)

It will say the window is visible when it's open, but not focused.

Should check that |this.recentWindow| == nsIWindowWatcher::activeWindow
Attached patch v1.0 (obsolete) — Splinter Review
Attachment #323575 - Flags: review?(edilee)
Comment on attachment 323575 [details] [diff] [review]
v1.0

>+++ b/toolkit/components/downloads/public/nsIDownloadManagerUI.idl
>+  * @throws NS_ERROR_UNEXPECTED if the UI is not opened.
Is this the only way to figure out if the download manager window is opened? Call getAttention and check for an exception? Perhaps we should add an |opened| property? .. perhaps a separate bug ;)

With the opened property, some of the code changes gets simplified..

get visible(): if (!this.opened) return false; ..
getAttention(): if (!this.opened) throw ..

>+++ b/toolkit/components/downloads/test/browser/browser_nsIDownloadManagerUI.js
>@@ -51,9 +51,12 @@ function test_getAttention_opened()
>+  is(dmui.visible, false,
>+     "nsIDownloadManagerUI inidicates that the UI is not visible");
>+
>   dmui.getAttention();
>-  is(dmui.visible, true,
>-     "nsIDownloadManagerUI indicates that the UI is visible");
>+  is(dmui.visible, false,
>+     "nsIDownloadManagerUI indicates that the UI is not visible");
> }
Can we also get a test to assert transitions from true -> false and false -> true? Perhaps update test_visibility_open() to assert true, focus window, assert false, show window, assert true again.
Attached patch v2.0Splinter Review
addresses review comments
Attachment #323575 - Attachment is obsolete: true
Attachment #323582 - Flags: review?(edilee)
Attachment #323575 - Flags: review?(edilee)
Comment on attachment 323582 [details] [diff] [review]
v2.0

r=Mardak

>+  readonly attribute boolean open;
Up to you if you want to keep it as "open". Open is also a verb, so it could be confused as a method. But that's why there's documentation! ;)
Attachment #323582 - Flags: review?(edilee) → review+
Whiteboard: [has patch][has review][can land]
Left it as is since it's an attribute in the idl.

Pushed to mozilla-central with changeset a26c86b184f7
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
Whiteboard: [has patch][has review][can land]
unit tests failed on linux.  Weird.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The cause of the orange is documented in bug 437283.
Depends on: 437283
Whiteboard: [needs new patch]
Product: Firefox → Toolkit
Assignee: sdwilsh → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: