Closed Bug 1071548 Opened 10 years ago Closed 7 years ago

BrowserWindow class misses close() method

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect, P2)

defect

Tracking

(firefox32 wontfix, firefox33 wontfix, firefox34 affected, firefox35 affected, firefox-esr31 wontfix)

RESOLVED INVALID
Tracking Status
firefox32 --- wontfix
firefox33 --- wontfix
firefox34 --- affected
firefox35 --- affected
firefox-esr31 --- wontfix

People

(Reporter: whimboo, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

The BrowserWindow class as implemented in bug 1047235 is missing its own close() method. It should overwrite the BaseWindow close() method by allowing to specify the menu, shortcut etc. Itself it can then call the BaseWindow method with its own callback.

Daniel, would you mind getting this implemented. It will help us in tests where we have to handle multiple windows.
Assignee: nobody → daniel.gherasim
Attached patch fix_v1.patch (obsolete) — Splinter Review
Up for review! :)
Attachment #8494434 - Flags: review?(andrei.eftimie)
Attachment #8494434 - Flags: review?(andreea.matei)
Status: NEW → ASSIGNED
Comment on attachment 8494434 [details] [diff] [review]
fix_v1.patch

Review of attachment 8494434 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the nit fixed.

::: firefox/lib/ui/browser.js
@@ +58,5 @@
> +    case "menu":
> +      callback = () => { this._controller.mainMenu.click("#menu_closeWindow"); }
> +      break;
> +    case "shortcut":
> +       var closeWindowKey = utils.getEntity(this.dtds, "closeWindow.key");

nit: indentation is a bit off
Attachment #8494434 - Flags: review?(andrei.eftimie)
Attachment #8494434 - Flags: review?(andreea.matei)
Attachment #8494434 - Flags: review+
Attached patch fix_v2.patchSplinter Review
Done!
Attachment #8494434 - Attachment is obsolete: true
Attachment #8497416 - Flags: review?(hskupin)
Comment on attachment 8497416 [details] [diff] [review]
fix_v2.patch

Review of attachment 8497416 [details] [diff] [review]:
-----------------------------------------------------------------

::: firefox/lib/ui/browser.js
@@ +22,5 @@
>    this._controller = aController || mozmill.getBrowserController();
>    this._dtds = ["chrome://branding/locale/brand.dtd",
>                  "chrome://browser/locale/browser.dtd",
> +                "chrome://browser/locale/aboutPrivateBrowsing.dtd",
> +                "chrome://browser/locale/pageInfo.dtd"];

Mind helping me why we need this extra DTD file?

@@ +27,4 @@
>  }
>  
>  BrowserWindow.prototype = new baseWindow.BaseWindow(true);
>  BrowserWindow.prototype.constructor = BrowserWindow;

Do you mind changing this to Object.create() similar to the latest software update changes? Anything else about inheritance we will discuss on the other bug.

@@ +44,5 @@
> + *        Define new function that closes the window
> + * @param {boolean} [aSpec.force=false]
> + *        Force closing the window
> + */
> +BrowserWindow.prototype.close = function BrowserWindow_close(aSpec={}) {

nit: To reduce the line length we should use the prefix 'BW_' for the internal name.

@@ +50,5 @@
> +  var callback = null;
> +
> +  if (aSpec.force) {
> +    baseWindow.BaseWindow.prototype.close.call(this);
> +    return;

Why are you not waiting for the observer notifications here?

@@ +62,5 @@
> +      var closeWindowKey = utils.getEntity(this.dtds, "closeWindow.key");
> +      callback = () => {
> +        this._controller.keypress(null, closeWindowKey, {accelKey: true,
> +                                                         shiftKey: true});
> +      }

I like the definition of the individual callback methods. Can we do the same for the open() method too?
Attachment #8497416 - Flags: review?(hskupin) → review-
Assignee: danisielm → nobody
Status: ASSIGNED → NEW
Mozmill tests have been superseded by Marionette tests.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: