Convert XPCOM test TestObserverService to a gtest

RESOLVED FIXED in Firefox 52

Status

()

Core
XPCOM
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: erahm, Assigned: erahm)

Tracking

unspecified
mozilla52
Points:
---

Firefox Tracking Flags

(firefox52 fixed)

Details

Attachments

(4 attachments)

Convert xpcom/tests/TestObserverService.cpp to a gtest and move to xpcom/tests/gtest/.
Just a note: it looks like this test currently doesn't do anything because it doesn't have a ScopedXPCOM declaration.
Created attachment 8806826 [details] [diff] [review]
Part 0: Cleanup indentation

MozReview-Commit-ID: 7PAMbXHB5Ws
Attachment #8806826 - Flags: review?(nfroyd)
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Created attachment 8806827 [details] [diff] [review]
Part 0-1: Add missing includes to unified gtests

MozReview-Commit-ID: 4KVwMQJcAIS
Attachment #8806827 - Flags: review?(nfroyd)
Created attachment 8806828 [details] [diff] [review]
Part 1: Convert TestObserverService to a gtest

This is a straightforward conversion to a gtest. The test itself is updated
to use RefPtr/nsCOMPtr where appropriate to avoid memory leaks.

MozReview-Commit-ID: JyHF3iTaoOg
Attachment #8806828 - Flags: review?(nfroyd)
Created attachment 8806829 [details] [diff] [review]
Part 2: Expand and split out TestObserverService tests

This splits out enumertion testing, adds testing of weak references, and other
basic tests for add and remove functions.

MozReview-Commit-ID: CLEafPJhe3z
Attachment #8806829 - Flags: review?(nfroyd)
Attachment #8806826 - Flags: review?(nfroyd) → review+
Attachment #8806827 - Flags: review?(nfroyd) → review+
Comment on attachment 8806828 [details] [diff] [review]
Part 1: Convert TestObserverService to a gtest

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

::: xpcom/tests/gtest/TestObserverService.cpp
@@ -55,5 @@
> -  nsCString topic( aTopic );
> -  nsString data( someData );
> -  /*
> -     The annoying double-cast below is to work around an annoying bug in
> -     the compiler currently used on wensleydale.  This is a test.

o.O
Attachment #8806828 - Flags: review?(nfroyd) → review+
Attachment #8806829 - Flags: review?(nfroyd) → review+

Comment 8

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9559827d07d0
https://hg.mozilla.org/mozilla-central/rev/fd302c72543d
https://hg.mozilla.org/mozilla-central/rev/921433b91312
https://hg.mozilla.org/mozilla-central/rev/a3b30fb7d3e6
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.