Closed
Bug 585733
Opened 14 years ago
Closed 14 years ago
Make Mozmill-test testDisableCookies local
Categories
(Mozilla QA Graveyard :: Mozmill Tests, defect)
Mozilla QA Graveyard
Mozmill Tests
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: u279076, Assigned: aaronmt)
References
Details
(Whiteboard: [litmus-data])
Attachments
(3 files, 5 obsolete files)
(deleted),
patch
|
whimboo
:
review-
|
Details | Diff | Splinter Review |
(deleted),
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
Module: testCookies/testDisableCookies.js
Test-page: test-files/cookies/cookie_single.html
Assignee | ||
Comment 1•14 years ago
|
||
cleanup + converts test to make use of local-data
Assignee: nobody → aaron.train
Status: NEW → ASSIGNED
Attachment #467024 -
Flags: review?(anthony.s.hughes)
Comment on attachment 467024 [details] [diff] [review]
Patch v1 - (default)
>+ cm = Cc["@mozilla.org/cookiemanager;1"]
>+ .getService(Ci.nsICookieManager2);
> cm.removeAll();
Please move the . to the end of the first line and indent getService 2 spaces from Cc.
Adding feedback? for Henrik. Henrik, I'm thinking we shouldn't have any code like this in tests. We should move this to an API (testCookiesAPI in this case). Even if the API file is only a few lines, it can be built out as we go. I don't think we should burden our community with having to know this stuff. Could/should we add this to the refactor work?
Attachment #467024 -
Flags: review?(anthony.s.hughes)
Attachment #467024 -
Flags: review-
Attachment #467024 -
Flags: feedback?(hskupin)
Comment 3•14 years ago
|
||
(In reply to comment #2)
> >+ cm = Cc["@mozilla.org/cookiemanager;1"]
> >+ .getService(Ci.nsICookieManager2);
> > cm.removeAll();
>
> Please move the . to the end of the first line and indent getService 2 spaces
> from Cc.
Please don't indent. Should start at the same column.
> Adding feedback? for Henrik. Henrik, I'm thinking we shouldn't have any code
> like this in tests. We should move this to an API (testCookiesAPI in this
> case). Even if the API file is only a few lines, it can be built out as we go.
> I don't think we should burden our community with having to know this stuff.
> Could/should we add this to the refactor work?
Makes sense. I wouldn't wait for the refactoring but go ahead. File a new bug which adds the CookieAPI and the functions we need. Further all tests which make use of it should be updated too.
Updated•14 years ago
|
Attachment #467024 -
Flags: feedback?(hskupin) → feedback+
Assignee | ||
Comment 4•14 years ago
|
||
fixes indentation
Takes Anthony's comment about the . at the end, and Henrik's about two spaces from the margin. If this is still wrong, you guys need to come to agreement
Attachment #471554 -
Flags: review?(anthony.s.hughes)
Comment 5•14 years ago
|
||
With no indentation I meant no 2 more blanks. Sorry. See the following code:
http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#267
(In reply to comment #5)
> With no indentation I meant no 2 more blanks. Sorry. See the following code:
> http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#267
Yes, Aaron, follow this example.
FYI, if you ever have any formatting questions, always assume the Mozilla Style guidelines. You can refer to source code on MXR for examples.
Assignee | ||
Updated•14 years ago
|
Attachment #471554 -
Attachment is obsolete: true
Attachment #471554 -
Flags: review?(anthony.s.hughes)
Assignee | ||
Comment 7•14 years ago
|
||
Sold. Using the example.
Attachment #471557 -
Flags: review?(anthony.s.hughes)
Attachment #471557 -
Flags: review?(hskupin)
Attachment #471557 -
Flags: review?(anthony.s.hughes)
Attachment #471557 -
Flags: review+
Comment 8•14 years ago
|
||
Comment on attachment 471557 [details] [diff] [review]
Patch v1.2 - (default)
This test will always pass due to the missing update of the following line:
controller.assertJS("subject.cookieCount == 0",
{cookieCount : cm.countCookiesFromHost(".mozilla.org")});
Attachment #471557 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 9•14 years ago
|
||
Good catch. The cookie preferences manager for the cookie we create in cookie_single.html, has no specified domain nor a comparable path, i.e., (/Users/Aaron/). Can we use cookieExists to check for a blank domain and none specific path for this local cookie we create?
Assignee | ||
Comment 10•14 years ago
|
||
Scratch that above comment, was thinking locally instead of localhost.
Patch changes the assert to check the count of the cookies from host localhost
Attachment #467024 -
Attachment is obsolete: true
Attachment #471557 -
Attachment is obsolete: true
Attachment #474823 -
Flags: review?(hskupin)
Comment 11•14 years ago
|
||
Comment on attachment 474823 [details] [diff] [review]
Patch v1.3 - [localhost] - (default)
>- // Search for a cookie from mozilla.org and verify cookies are not saved
>+ // Search for a cookie from localhost and verify cookies are not saved
> controller.assertJS("subject.cookieCount == 0",
>- {cookieCount : cm.countCookiesFromHost(".mozilla.org")});
>+ {cookieCount : cm.countCookiesFromHost("localhost")});
I don't like that we hard-code the value. Please grab the hostname directly from the url in the locationbar after the test page has been loaded. There is an API function you can use. It's fairly straight forward.
Attachment #474823 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 12•14 years ago
|
||
You talking about nsIURI.host or simply window.content.location.hostname?
Comment 13•14 years ago
|
||
Whatever makes it easier.
Assignee | ||
Comment 14•14 years ago
|
||
Attachment #474823 -
Attachment is obsolete: true
Attachment #477124 -
Flags: review?(hskupin)
Comment 15•14 years ago
|
||
Comment on attachment 477124 [details] [diff] [review]
Patch v1.4 - [fix from comment 11] - (default)
Same as for the other cookie test. Please use persisted to store values which are shared between functions.
In the future only update one of the tests which need the same updates. It will lower the amount of review work.
Attachment #477124 -
Flags: review?(hskupin) → review-
Assignee | ||
Comment 16•14 years ago
|
||
Attachment #477499 -
Flags: review?(hskupin)
Assignee | ||
Updated•14 years ago
|
Attachment #477499 -
Flags: review?(hskupin)
Assignee | ||
Updated•14 years ago
|
Attachment #477499 -
Attachment is obsolete: true
Assignee | ||
Comment 17•14 years ago
|
||
Please let this be the last one :D
Attachment #477504 -
Flags: review?(hskupin)
Comment 18•14 years ago
|
||
Comment on attachment 477504 [details] [diff] [review]
Patch v1.5 - (default)
>+ persisted.hostName = {};
The last part you will have to update is that line. Please assign 'undefined' otherwise we have an empty object lingering around for the remaining tests.
With that change r=me.
Attachment #477504 -
Flags: review?(hskupin) → review+
Assignee | ||
Comment 19•14 years ago
|
||
Keywords: checkin-needed
Reporter | ||
Comment 20•14 years ago
|
||
(In reply to comment #19)
> Created attachment 477953 [details] [diff] [review]
> Patch v1.5 - (default + teardown change)
Landed:
http://hg.mozilla.org/qa/mozmill-tests/rev/9a2c4c472264 [default]
http://hg.mozilla.org/qa/mozmill-tests/rev/d1e39d7472f8 [mozilla1.9.2]
http://hg.mozilla.org/qa/mozmill-tests/rev/c1f94b26ce1c [mozilla1.9.1]
Comment 21•14 years ago
|
||
Move of Mozmill Test related project bugs to newly created components. You can
filter out those emails by using "Mozmill-Tests-to-MozillaQA" as criteria.
Product: Testing → Mozilla QA
Updated•5 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•