Closed
Bug 629539
Opened 15 years ago
Closed 15 years ago
test that proper visit notifications are dispatched (test_async_history_api.js)
Categories
(Toolkit :: Places, defect)
Tracking
()
RESOLVED
FIXED
mozilla2.0b12
| Tracking | Status | |
|---|---|---|
| blocking2.0 | --- | final+ |
People
(Reporter: sdwilsh, Assigned: sdwilsh)
References
Details
(Whiteboard: [softblocker])
Attachments
(1 file, 3 obsolete files)
|
3.68 KB,
patch
|
Details | Diff | Splinter Review |
Follow-up to bug 606966. We need to test that proper visit notifications are dispatched.
| Assignee | ||
Updated•15 years ago
|
blocking2.0: --- → final+
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → sdwilsh
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•15 years ago
|
||
We already have onTitleChanged covered. Happy days!
| Assignee | ||
Comment 2•15 years ago
|
||
onPageChanged cannot be tested due to bug 626836.
| Assignee | ||
Comment 3•15 years ago
|
||
This means we only need to test for:
onVisit
uri-visit-saved observer service topic
| Assignee | ||
Comment 4•15 years ago
|
||
Attachment #512644 -
Flags: review?(mak77)
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [softblocker] → [softblocker][needs review mak]
Comment 5•15 years ago
|
||
Comment on attachment 512644 [details] [diff] [review]
v1.0
>diff --git a/toolkit/components/places/tests/unit/test_async_history_api.js b/toolkit/components/places/tests/unit/test_async_history_api.js
> const TEST_DOMAIN = "http://mozilla.org/";
> const TOPIC_UPDATEPLACES_COMPLETE = "places-updatePlaces-complete";
>+const URI_VISIT_SAVED = "uri-visit-saved";
use TOPIC_ prefix coherently please
>+VisitObserver.prototype = {
>+ __proto__: NavHistoryObserver.prototype,
>+ onVisit: function(aURI,
>+ aVisitId,
>+ aTime,
>+ aSessionId,
>+ aReferringId,
>+ aTransitionType)
>+ {
>+ do_log_info("onVisit(" + aURI.spec + ", " + aVisitId + ", " + aTime +
>+ ", " + aSessionId + ", " + aReferringId + ", " +
>+ aTransitionType + ")");
>+ if (!this.uri.equals(aURI)) {
>+ return;
>+ }
>+ this.callback(aURI, aTime, aTransitionType);
aURI in the callback seems completely useless, this listener is already bound to a certain uri (indeed you don't use aURI later)
>+ let observer = {
>+ observe: function(aSubject, aTopic, aData)
>+ {
>+ do_log_info("observe(" + aSubject + ", " + aTopic + ", " + aData + ")");
>+ do_check_true(aSubject instanceof Ci.nsIURI);
>+ do_check_true(aSubject.equals(place.uri));
>+
>+ Services.obs.removeObserver(observer, URI_VISIT_SAVED);
>+ finisher();
>+ },
>+ };
>+ Services.obs.addObserver(observer, URI_VISIT_SAVED, false);
you can use a function here rather than a object, saving some line of code
Attachment #512644 -
Flags: review?(mak77) → review+
| Assignee | ||
Comment 6•15 years ago
|
||
(In reply to comment #5)
> use TOPIC_ prefix coherently please
I would prefer to keep the CPP and JS constants named the same though.
Comment 7•15 years ago
|
||
(In reply to comment #6)
> (In reply to comment #5)
> > use TOPIC_ prefix coherently please
> I would prefer to keep the CPP and JS constants named the same though.
ah ok, then I guess why the cpp constants don't follow the same schema, I think most of them have TOPIC somewhere in the name.
Btw, I'm fine both ways then.
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [softblocker][needs review mak] → [softblocker]
| Assignee | ||
Comment 8•15 years ago
|
||
For checkin. This is a test-only change, so it doesn't need approval.
Attachment #512644 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•15 years ago
|
||
Something just landed that bitrots this. This fixes the bitrot.
Attachment #512896 -
Attachment is obsolete: true
| Assignee | ||
Comment 10•15 years ago
|
||
Comment on attachment 512902 [details] [diff] [review]
v1.2
not really...hg fail
Attachment #512902 -
Attachment is obsolete: true
| Assignee | ||
Comment 11•15 years ago
|
||
OK, this is it for real this time.
| Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 12•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b12
You need to log in
before you can comment on or make changes to this bug.
Description
•