Closed Bug 717963 Opened 13 years ago Closed 12 years ago

Use getBrowserURL() in Firefox tests to ease porting them, part 1

Categories

(Firefox :: General, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Firefox 13

People

(Reporter: sgautherie, Assigned: capella)

References

()

Details

Attachments

(1 file, 5 obsolete files)

"Found 2 matching lines in 2 files"

See bug 717753 as an example.
Blocks: 717969
No longer depends on: 717753
The comment says two files found, I currently find / change: test_embeds.xul.

   What's the other? I'll fix it...
Comment on attachment 595679 [details] [diff] [review]
Possible fix ...
[Moved to bug 725647]

(In reply to Mark Capella from comment #1)

> The comment says two files found, I currently find / change: test_embeds.xul.

Good catch!
Though this is not exactly this bug: I filed bug 725647 and assigned it to you.
Also, you copied the code I initially attached rather than the code I eventually checked in.

NB: In this case, I don't think you need to add the bug reference to the test, but reviewer would tell.

> What's the other? I'll fix it...

Thanks!
See 'URL' field of this bug.
Attachment #595679 - Attachment description: Possible fix ... → Possible fix ... [Moved to bug 725647]
Attachment #595679 - Attachment is obsolete: true
Attachment #595679 - Flags: feedback-
Assignee: nobody → markcapella
FYI and comments / feedback please...

   This bug would refer to changes in:

      File#1) /browser/components/sessionstore/test/browser_580512.js
      File#2) /browser/base/content/test/browser_bug422590.js

   File#1 is already using Services.prefs so the change seems to be:

      From ===>
      var newWin = openDialog("chrome://browser/content/", "_blank",
                          "chrome,dialog=no,toolbar=no", "about:blank");
      To   ===>
      var newWin = openDialog(Services.prefs.getCharPref("browser.chromeURL"), "_blank",
                          "chrome,dialog=no,toolbar=no", "about:blank");

   File#2 is not apparently using Services.prefs, so the change would be:

      From ===>
      var win = openDialog("chrome://browser/content/", "_blank",
                           "chrome,all,dialog=no", argURIs.join("|"));

      To   ===>
      Components.utils.import("resource://gre/modules/Services.jsm");       // If import required
      var win = openDialog(Services.prefs.getCharPref("browser.chromeURL"), "_blank",
                           "chrome,all,dialog=no", argURIs.join("|"));
(In reply to Mark Capella [:capella] from comment #3)

>       var newWin =
> openDialog(Services.prefs.getCharPref("browser.chromeURL"), "_blank",

Yes, that should be it.

>       Components.utils.import("resource://gre/modules/Services.jsm");      
> // If import required

Services.jsm should already be available to browser-chrome tests, iirc.
Attached patch Use "browser.chromeURL" (obsolete) — Splinter Review
Attachment #599556 - Flags: review?(sgautherie.bz)
Comment on attachment 599556 [details] [diff] [review]
Use "browser.chromeURL"

Please use getBrowserURL().
Attachment #599556 - Flags: review?(sgautherie.bz) → review-
Attached patch Use getBrowserURL() (obsolete) — Splinter Review
After a review+ I can do a TRY server AUTOLAND or ask someone to push it for me.
Attachment #599556 - Attachment is obsolete: true
Attachment #599566 - Flags: review?(sgautherie.bz)
You're replacing openDialog with window.openDialog for seemingly no good reason. Please don't do this.
Sorry, I grabbed the wrong code snip.
Attachment #599566 - Attachment is obsolete: true
Attachment #599566 - Flags: review?(sgautherie.bz)
Attachment #599571 - Flags: review?(sgautherie.bz)
Attachment #599571 - Flags: review?(sgautherie.bz) → review+
Whiteboard: [good first bug] → [autoland-try]
Whiteboard: [autoland-try] → [autoland-in-queue]
["Mid-air collision detected!", on review then on comment. Bah :-|]

(In reply to Dão Gottwald [:dao] from comment #6)
> Please use getBrowserURL().

Good catch: browser-chrome tests have access to this function (which SeaMonkey has too) :-)

(In reply to Mark Capella [:capella] from comment #7)
> After a review+ I can do a TRY server AUTOLAND or ask someone to push it for
> me.

No need for this trivial patch.
Status: NEW → ASSIGNED
Keywords: checkin-needed
Target Milestone: --- → Firefox 13
Thanks to all :-P
> [autoland-try]

And, for this patch, you should have used "-u mochitest-o" to save resources.
Attachment #599571 - Flags: feedback+
Attachment #599556 - Flags: feedback+
serge: Found this... http://trychooser.pub.build.mozilla.org/, will read
Autoland Patchset:
	Patches: 599571
	Branch: mozilla-central => try
Error applying patch 599571 to mozilla-central.
patching file browser/base/content/test/browser_bug422590.js
Hunk #1 FAILED at 2
1 out of 1 hunks FAILED -- saving rejects to file browser/base/content/test/browser_bug422590.js.rej
patching file browser/components/sessionstore/test/browser_580512.js
Hunk #1 FAILED at 34
1 out of 1 hunks FAILED -- saving rejects to file browser/components/sessionstore/test/browser_580512.js.rej
abort: patch failed to apply

Could not apply and push patchset:
Whiteboard: [autoland-in-queue]
(In reply to Mozilla RelEng Bot from comment #14)
> abort: patch failed to apply

Ftr,
Good wrt this bug, but rather odd wrt AutoLand :-/
I wonder whether the issue is with the patch (which looks good) or the (experimental) service.
(In reply to Serge Gautherie (:sgautherie) from comment #15)
> I wonder whether the issue is with the patch (which looks good) or the
> (experimental) service.

Autoland applies the patch to m-c tip. So either the patch needs unbitrotting, or it only applies cleanly on top of something that had not yet merged from inbound to m-c, but will be fine when landed directly on inbound.
I reviewed the DIFF file locally, and see my text editor had added WIN style CRLF's ... I can post the corrected DIFF if it's easiest to all...
(In reply to Mark Capella [:capella] from comment #17)
> I reviewed the DIFF file locally, and see my text editor had added WIN style
> CRLF's ... I can post the corrected DIFF if it's easiest to all...

Yes, please, we usually work with LF only.
Attached patch Use getBrowserURL() (obsolete) — Splinter Review
Attachment #599616 - Attachment description: DIFF no CR → Use getBrowserURL()
Attachment #599571 - Attachment description: 3d Try Patch → Use getBrowserURL() [Has CRLF :-(]
Attachment #599566 - Attachment description: 2nd Try Patch / DIFF File → Use getBrowserURL()
Attachment #599556 - Attachment description: Patch / DIFF File → USe "browser.chromeURL"
Attachment #599556 - Attachment description: USe "browser.chromeURL" → Use "browser.chromeURL"
Whiteboard: [c-n: patch 599616]
Mark, please add author and description to your patch, to ease c-n:
see http://blog.bonardo.net/2010/06/22/so-youre-about-to-use-checkin-needed
Sorry Serge, I'm still getting used to the process. Comment please.
Whiteboard: [c-n: patch 599616] → [c-n: patch 600409]
Comment on attachment 600409 [details] [diff] [review]
Use getBrowserURL()
[Checked in: Comment 27]

I added Author / Title to attachment ... looks like I need a re-review before checkin
Attachment #600409 - Flags: review?(dao)
Attachment #599616 - Attachment is obsolete: true
Comment on attachment 600409 [details] [diff] [review]
Use getBrowserURL()
[Checked in: Comment 27]

(In reply to Mark Capella [:capella] from comment #22)
> I added Author / Title to attachment ... looks like I need a re-review
> before checkin

No, you don't: the code is exactly the same.
Attachment #600409 - Attachment description: Use getBrowserURL(v2) No CR Has Author/Title → Use getBrowserURL()
Attachment #600409 - Flags: review?(dao)
Whiteboard: [c-n: patch 600409]
https://hg.mozilla.org/integration/mozilla-inbound/rev/89fbc0fd6006
Keywords: checkin-needed
Summary: Use "browser.chromeURL" preference in Firefox tests, to ease porting them → Use getBrowserURL() in Firefox tests to ease porting them
Ah, it looks like there is a few more:
http://mxr.mozilla.org/mozilla-central/search?string="chrome%3A%2F%2Fbrowser%2Fcontent%2Fbrowser.xul&case=1&find=%2Fbrowser%2F.*%2Ftest
"Found 4 matching lines in 3 files"
Attachment #599571 - Attachment is obsolete: true
I might have preferred to allow this patch to finish the move to production, and then to address these three files in a followup bug. With all the back and forth already on this, I'm getting the feeling of shooting a moving target. Are we sure the research is done now, and there won't be additional scope creep later?
Attachment #600409 - Attachment description: Use getBrowserURL() → Use getBrowserURL() [Checked in: Comment 27]
Attachment #600409 - Flags: checkin? → checkin+
(In reply to Mark Capella [:capella] from comment #26)

> I might have preferred to allow this patch to finish the move to production,
> and then to address these three files in a followup bug. With all the back

Sure. I was thinking about a second patch: this is still this bug.

> and forth already on this, I'm getting the feeling of shooting a moving
> target. Are we sure the research is done now, and there won't be additional
> scope creep later?

Sorry not to have been explicit about that earlier: the additional search is taken from bug 17969.
Please take it easy: "sure" vs "real life" :-|
I'm going to have to drop off this one due to my backlog and recent involvement with new development projects in the browser. I'd hoped to have had it completed by now, but it's fairly straight-forward, so I'll ask someone else to carry it to completion.
Assignee: markcapella → nobody
Status: ASSIGNED → NEW
Whiteboard: [ToDo: comment 25] [good first bug][mentor=sgautherie][lang=js]
File a new bug.
Assignee: nobody → markcapella
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [ToDo: comment 25] [good first bug][mentor=sgautherie][lang=js] → [good first bug][mentor=sgautherie][lang=js]
Blocks: 730840
(In reply to Dão Gottwald [:dao] from comment #30)
> File a new bug.

Bug 730840
Flags: in-testsuite+
Summary: Use getBrowserURL() in Firefox tests to ease porting them → Use getBrowserURL() in Firefox tests to ease porting them, part 1
Whiteboard: [good first bug][mentor=sgautherie][lang=js]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: