Write a gTest for mozilla::dom::DOMParser::CreateWithoutGlobal()
Categories
(Core :: DOM: Core & HTML, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: jorgk-bmo, Assigned: jorgk-bmo)
Details
Attachments
(1 file, 2 obsolete files)
2.88 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
M-C provides the mozilla::dom::DOMParser::CreateWithoutGlobal() function for us, but it's not tested anywhere, see bug 1454842 comment #13.
TB's processing of HTML mail relies on that function, see:
https://searchfox.org/comm-central/rev/30f32c40a88dc34746d22697dad8fe99c7922054/mailnews/mime/src/mimeTextHTMLParsed.cpp#83
I'm sure other tests would pick up a failure, but we should also test the function directly now that we have gTests in automation.
Assignee | ||
Comment 1•4 years ago
|
||
mach gtest TestMailParser*
Assignee | ||
Comment 2•4 years ago
|
||
Comment on attachment 9099107 [details] [diff] [review] C-C version: 1583348-gtest-parser.patch Let's see whether we can stick the test into M-C. I'll prepare a patch for that.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Hello Boris, this is a follow-up to bug 1454842 comment #11. Can we implement this test in M-C so we notice a problem before it's committed? mach gtest TestParser*
runs the test successfully. Please let me know which changes you require. Or whether you prefer not to have it in M-C.
![]() |
||
Comment 4•4 years ago
|
||
Comment on attachment 9099234 [details] [diff] [review] M-C version: 1583348-gtest-parser.patch >+ nsString htmlInput; >+ htmlInput.AssignLiteral( >+ "<html><head>" >+ "<meta http-equiv=\"content-type\" content=\"text/html; charset=\">" >+ "</head><body>Hello <b>Thunderbird!</b></body></html>"); Any reason this is not NS_NAMED_LITERAL_STRING? >+ RefPtr<mozilla::dom::DOMParser> parser = >+ mozilla::dom::DOMParser::CreateWithoutGlobal(rv2); If rv2 here fails, something needs to happen. Probably break? >+ nsCOMPtr<mozilla::dom::Document> document = parser->ParseFromString( >+ htmlInput, mozilla::dom::SupportedType::Text_html, rv2); >+ if (rv2.Failed()) break; rv2 should be an IgnoredErrorResult; otherwise this will assert if the failure path is taken. >+ printf("all tests passed\n"); Why?
Assignee | ||
Comment 5•4 years ago
•
|
||
Thanks, Boris, could you stick the r+ onto it one more time.
EDIT: https://bugzilla.mozilla.org/attachment.cgi?oldid=9099234&action=interdiff&newid=9099710&headers=1
The answer to all your questions is possibly lack of experience.
mach gtest TestParser*
still passes.
![]() |
||
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Dear sheriff, can you please land the attached patch the old-fashioned way.
Please import the patch with
hg qimport bz:1583348
or
hg qimport https://bugzilla.mozilla.org/attachment.cgi?id=9099710 -n 1583348.patch
to avoid changing the author.
Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7ec88fbbfcf8
Implement gTest for mozilla::dom::DOMParser::CreateWithoutGlobal(). r=bz
Comment 8•4 years ago
|
||
bugherder |
Description
•