Closed Bug 495137 Opened 15 years ago Closed 15 years ago

Add platform members (isLinux, isMac, isWindows) to mozmill class

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: whimboo, Assigned: adam.christian)

References

Details

(Whiteboard: [mozmill-doc-needed][verified-mozmill-1.2])

It would be great to have simple class members like isLinux, isMac, and isWindows to check on which operating systems we are running the test. It should look like my test is it doing now: https://bug494071.bugzilla.mozilla.org/attachment.cgi?id=379977
There already is a platform string that you can use for that. You can just do a simple string comparison instead of calling a function.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
Mikeal, no function will be called. During initialization of Mozmill you can create class members which will be true/false. From now on we even wouldn't have to do a string comparison anymore which will save us time. Think about having Mozmill run on directories with hundreds of tests where we need those checks. Further it makes it more style friendly and you will have a better overview, e.g.: controller.keypress(null, "k", {metaKey: mozmill.isMac, ctrlKey: !mozmill.isMac}); vs controller.keypress(null, "k", {metaKey: (mozmill.platform == "darwin"), ctrlKey: !(mozmill.platform == "darwin")});
Mikeal?
After talking to Mikeal on IRC we clarified my needs and it is on the list for Mozmill 1.2. Reopening for the upcoming work.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Whiteboard: [mozmill-1.2]
Committed revision 472.
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Adam, why not simplifying it like: > var isMac = (platform == "darwin");
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Simply cranking things out in a rush, if you are that adamant about the implementation feel free to patch.
Alright. That would make more work. Lets push it for a later refactoring. I'll check it right now. Thanks Adam.
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Works great. I'll update existing tests.
Assignee: nobody → adam.christian
Blocks: 493226
Status: RESOLVED → VERIFIED
Whiteboard: [mozmill-1.2] → [verified-mozmill-1.2]
Whiteboard: [verified-mozmill-1.2] → [mozmill-doc-needed][verified-mozmill-1.2]
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.