diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/base/test/gtest | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/test/gtest')
-rw-r--r-- | dom/base/test/gtest/TestMimeType.cpp | 142 |
1 files changed, 70 insertions, 72 deletions
diff --git a/dom/base/test/gtest/TestMimeType.cpp b/dom/base/test/gtest/TestMimeType.cpp index fecb3f8678..40916130a8 100644 --- a/dom/base/test/gtest/TestMimeType.cpp +++ b/dom/base/test/gtest/TestMimeType.cpp @@ -9,12 +9,10 @@ #include "MimeType.h" #include "nsString.h" -using mozilla::UniquePtr; - TEST(MimeType, EmptyString) { const auto in = u""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Empty string"; } @@ -22,7 +20,7 @@ TEST(MimeType, EmptyString) TEST(MimeType, JustWhitespace) { const auto in = u" \t\r\n "_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Just whitespace"; } @@ -30,7 +28,7 @@ TEST(MimeType, JustWhitespace) TEST(MimeType, JustBackslash) { const auto in = u"\\"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Just backslash"; } @@ -38,7 +36,7 @@ TEST(MimeType, JustBackslash) TEST(MimeType, JustForwardslash) { const auto in = u"/"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Just forward slash"; } @@ -46,7 +44,7 @@ TEST(MimeType, JustForwardslash) TEST(MimeType, MissingType1) { const auto in = u"/bogus"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Missing type #1"; } @@ -54,7 +52,7 @@ TEST(MimeType, MissingType1) TEST(MimeType, MissingType2) { const auto in = u" \r\n\t/bogus"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Missing type #2"; } @@ -62,7 +60,7 @@ TEST(MimeType, MissingType2) TEST(MimeType, MissingSubtype1) { const auto in = u"bogus"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Missing subtype #1"; } @@ -70,7 +68,7 @@ TEST(MimeType, MissingSubtype1) TEST(MimeType, MissingSubType2) { const auto in = u"bogus/"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Missing subtype #2"; } @@ -78,7 +76,7 @@ TEST(MimeType, MissingSubType2) TEST(MimeType, MissingSubType3) { const auto in = u"bogus;"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Missing subtype #3"; } @@ -86,7 +84,7 @@ TEST(MimeType, MissingSubType3) TEST(MimeType, MissingSubType4) { const auto in = u"bogus; \r\n\t"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Missing subtype #3"; } @@ -94,7 +92,7 @@ TEST(MimeType, MissingSubType4) TEST(MimeType, ExtraForwardSlash) { const auto in = u"bogus/bogus/;"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Extra forward slash"; } @@ -102,7 +100,7 @@ TEST(MimeType, ExtraForwardSlash) TEST(MimeType, WhitespaceInType) { const auto in = u"t\re\nx\tt /html"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Type with whitespace"; } @@ -110,7 +108,7 @@ TEST(MimeType, WhitespaceInType) TEST(MimeType, WhitespaceInSubtype) { const auto in = u"text/ h\rt\nm\tl"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Subtype with whitespace"; } @@ -118,7 +116,7 @@ TEST(MimeType, WhitespaceInSubtype) TEST(MimeType, NonAlphanumericMediaType1) { const auto in = u"</>"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-alphanumeric media type #1"; } @@ -126,7 +124,7 @@ TEST(MimeType, NonAlphanumericMediaType1) TEST(MimeType, NonAlphanumericMediaType2) { const auto in = u"(/)"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-alphanumeric media type #2"; } @@ -134,7 +132,7 @@ TEST(MimeType, NonAlphanumericMediaType2) TEST(MimeType, NonAlphanumericMediaType3) { const auto in = u"{/}"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-alphanumeric media type #3"; } @@ -142,7 +140,7 @@ TEST(MimeType, NonAlphanumericMediaType3) TEST(MimeType, NonAlphanumericMediaType4) { const auto in = u"\"/\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-alphanumeric media type #4"; } @@ -150,7 +148,7 @@ TEST(MimeType, NonAlphanumericMediaType4) TEST(MimeType, NonAlphanumericMediaType5) { const auto in = u"\0/\0"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-alphanumeric media type #5"; } @@ -158,7 +156,7 @@ TEST(MimeType, NonAlphanumericMediaType5) TEST(MimeType, NonAlphanumericMediaType6) { const auto in = u"text/html(;doesnot=matter"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-alphanumeric media type #6"; } @@ -166,7 +164,7 @@ TEST(MimeType, NonAlphanumericMediaType6) TEST(MimeType, NonLatin1MediaType1) { const auto in = u"ÿ/ÿ"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-latin1 media type #1"; } @@ -174,7 +172,7 @@ TEST(MimeType, NonLatin1MediaType1) TEST(MimeType, NonLatin1MediaType2) { const auto in = u"\x0100/\x0100"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_FALSE(parsed) << "Non-latin1 media type #2"; } @@ -182,7 +180,7 @@ TEST(MimeType, NonLatin1MediaType2) TEST(MimeType, MultipleParameters) { const auto in = u"text/html;charset=gbk;no=1;charset_=gbk_;yes=2"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsString out; @@ -194,7 +192,7 @@ TEST(MimeType, MultipleParameters) TEST(MimeType, DuplicateParameter1) { const auto in = u"text/html;charset=gbk;charset=windows-1255"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsString out; @@ -206,7 +204,7 @@ TEST(MimeType, DuplicateParameter1) TEST(MimeType, DuplicateParameter2) { const auto in = u"text/html;charset=();charset=GBK"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsString out; @@ -218,7 +216,7 @@ TEST(MimeType, DuplicateParameter2) TEST(MimeType, CString) { const auto in = "text/html;charset=();charset=GBK"_ns; - UniquePtr<CMimeType> parsed = CMimeType::Parse(in); + RefPtr<CMimeType> parsed = CMimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsCString out; @@ -234,7 +232,7 @@ TEST(MimeType, CString) TEST(MimeType, NonAlphanumericParametersAreQuoted) { const auto in = u"text/html;test=\x00FF\\;charset=gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsString out; @@ -249,7 +247,7 @@ TEST(MimeType, NonAlphanumericParametersAreQuoted) TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace1) { const auto in = u"text/html;charset= g\\\"bk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -261,7 +259,7 @@ TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace1) TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace2) { const auto in = u"text/html;charset= \"g\\bk\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -273,7 +271,7 @@ TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace2) TEST(MimeType, ParameterQuotedIfHasInternalWhitespace) { const auto in = u"text/html;charset=g \\b\"k"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -285,7 +283,7 @@ TEST(MimeType, ParameterQuotedIfHasInternalWhitespace) TEST(MimeType, ImproperlyQuotedParameter1) { const auto in = u"x/x;test=\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -297,7 +295,7 @@ TEST(MimeType, ImproperlyQuotedParameter1) TEST(MimeType, ImproperlyQuotedParameter2) { const auto in = u"x/x;test=\"\\"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -309,7 +307,7 @@ TEST(MimeType, ImproperlyQuotedParameter2) TEST(MimeType, NonLatin1ParameterIgnored) { const auto in = u"x/x;test=\xFFFD;x=x"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -321,7 +319,7 @@ TEST(MimeType, NonLatin1ParameterIgnored) TEST(MimeType, ParameterIgnoredIfWhitespaceInName1) { const auto in = u"text/html;charset =gbk;charset=123"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -333,7 +331,7 @@ TEST(MimeType, ParameterIgnoredIfWhitespaceInName1) TEST(MimeType, ParameterIgnoredIfWhitespaceInName2) { const auto in = u"text/html;cha rset =gbk;charset=123"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -345,7 +343,7 @@ TEST(MimeType, ParameterIgnoredIfWhitespaceInName2) TEST(MimeType, WhitespaceTrimmed) { const auto in = u"\n\r\t text/plain\n\r\t ;\n\r\t charset=123\n\r\t "_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -357,7 +355,7 @@ TEST(MimeType, WhitespaceTrimmed) TEST(MimeType, WhitespaceOnlyParameterIgnored) { const auto in = u"x/x;x= \r\n\t"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -369,7 +367,7 @@ TEST(MimeType, WhitespaceOnlyParameterIgnored) TEST(MimeType, IncompleteParameterIgnored1) { const auto in = u"x/x;test"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -381,7 +379,7 @@ TEST(MimeType, IncompleteParameterIgnored1) TEST(MimeType, IncompleteParameterIgnored2) { const auto in = u"x/x;test="_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -393,7 +391,7 @@ TEST(MimeType, IncompleteParameterIgnored2) TEST(MimeType, IncompleteParameterIgnored3) { const auto in = u"x/x;test= \r\n\t"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -405,7 +403,7 @@ TEST(MimeType, IncompleteParameterIgnored3) TEST(MimeType, IncompleteParameterIgnored4) { const auto in = u"text/html;test;charset=gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -417,7 +415,7 @@ TEST(MimeType, IncompleteParameterIgnored4) TEST(MimeType, IncompleteParameterIgnored5) { const auto in = u"text/html;test=;charset=gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -429,7 +427,7 @@ TEST(MimeType, IncompleteParameterIgnored5) TEST(MimeType, EmptyParameterIgnored1) { const auto in = u"text/html ; ; charset=gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -441,7 +439,7 @@ TEST(MimeType, EmptyParameterIgnored1) TEST(MimeType, EmptyParameterIgnored2) { const auto in = u"text/html;;;;charset=gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -453,7 +451,7 @@ TEST(MimeType, EmptyParameterIgnored2) TEST(MimeType, InvalidParameterIgnored1) { const auto in = u"text/html;';charset=gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -465,7 +463,7 @@ TEST(MimeType, InvalidParameterIgnored1) TEST(MimeType, InvalidParameterIgnored2) { const auto in = u"text/html;\";charset=gbk;=123; =321"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -477,7 +475,7 @@ TEST(MimeType, InvalidParameterIgnored2) TEST(MimeType, InvalidParameterIgnored3) { const auto in = u"text/html;charset= \"\u007F;charset=GBK"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -490,7 +488,7 @@ TEST(MimeType, InvalidParameterIgnored4) { const auto in = nsLiteralString( u"text/html;charset=\"\u007F;charset=foo\";charset=GBK;charset="); - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -502,7 +500,7 @@ TEST(MimeType, InvalidParameterIgnored4) TEST(MimeType, SingleQuotes1) { const auto in = u"text/html;charset='gbk'"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -514,7 +512,7 @@ TEST(MimeType, SingleQuotes1) TEST(MimeType, SingleQuotes2) { const auto in = u"text/html;charset='gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -526,7 +524,7 @@ TEST(MimeType, SingleQuotes2) TEST(MimeType, SingleQuotes3) { const auto in = u"text/html;charset=gbk'"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -538,7 +536,7 @@ TEST(MimeType, SingleQuotes3) TEST(MimeType, SingleQuotes4) { const auto in = u"text/html;charset=';charset=GBK"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -550,7 +548,7 @@ TEST(MimeType, SingleQuotes4) TEST(MimeType, SingleQuotes5) { const auto in = u"text/html;charset=''';charset=GBK"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -562,7 +560,7 @@ TEST(MimeType, SingleQuotes5) TEST(MimeType, DoubleQuotes1) { const auto in = u"text/html;charset=\"gbk\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -574,7 +572,7 @@ TEST(MimeType, DoubleQuotes1) TEST(MimeType, DoubleQuotes2) { const auto in = u"text/html;charset=\"gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -586,7 +584,7 @@ TEST(MimeType, DoubleQuotes2) TEST(MimeType, DoubleQuotes3) { const auto in = u"text/html;charset=gbk\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -598,7 +596,7 @@ TEST(MimeType, DoubleQuotes3) TEST(MimeType, DoubleQuotes4) { const auto in = u"text/html;charset=\" gbk\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -610,7 +608,7 @@ TEST(MimeType, DoubleQuotes4) TEST(MimeType, DoubleQuotes5) { const auto in = u"text/html;charset=\"gbk \""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -622,7 +620,7 @@ TEST(MimeType, DoubleQuotes5) TEST(MimeType, DoubleQuotes6) { const auto in = u"text/html;charset=\"\\ gbk\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -634,7 +632,7 @@ TEST(MimeType, DoubleQuotes6) TEST(MimeType, DoubleQuotes7) { const auto in = u"text/html;charset=\"\\g\\b\\k\""_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -646,7 +644,7 @@ TEST(MimeType, DoubleQuotes7) TEST(MimeType, DoubleQuotes8) { const auto in = u"text/html;charset=\"gbk\"x"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -658,7 +656,7 @@ TEST(MimeType, DoubleQuotes8) TEST(MimeType, DoubleQuotes9) { const auto in = u"text/html;charset=\"\";charset=GBK"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -670,7 +668,7 @@ TEST(MimeType, DoubleQuotes9) TEST(MimeType, DoubleQuotes10) { const auto in = u"text/html;charset=\";charset=GBK"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -682,7 +680,7 @@ TEST(MimeType, DoubleQuotes10) TEST(MimeType, UnexpectedCodePoints) { const auto in = u"text/html;charset={gbk}"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -699,7 +697,7 @@ TEST(MimeType, LongTypesSubtypesAccepted) "2345678901234567890123456789012345678901234567890123456789/" "012345678901234567890123456789012345678901234567890123456789012345678901" "2345678901234567890123456789012345678901234567890123456789"); - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -716,7 +714,7 @@ TEST(MimeType, LongParametersAccepted) "012345678901234567890123456789012345678901234567890123456789012345678901" "2345678901234567890123456789012345678901234567890123456789=x;charset=" "gbk"); - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -744,7 +742,7 @@ TEST(MimeType, AllValidCharactersAccepted1) u"\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED" u"\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8" u"\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF\""); - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -756,7 +754,7 @@ TEST(MimeType, AllValidCharactersAccepted1) TEST(MimeType, CaseNormalization1) { const auto in = u"TEXT/PLAIN;CHARSET=TEST"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -775,7 +773,7 @@ TEST(MimeType, CaseNormalization2) ".^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=!#$" "%&'*+-.^_`|~" "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -794,7 +792,7 @@ TEST(MimeType, CaseNormalization2) TEST(MimeType, LegacyCommentSyntax1) { const auto in = u"text/html;charset=gbk("_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; @@ -806,7 +804,7 @@ TEST(MimeType, LegacyCommentSyntax1) TEST(MimeType, LegacyCommentSyntax2) { const auto in = u"text/html;x=(;charset=gbk"_ns; - UniquePtr<MimeType> parsed = MimeType::Parse(in); + RefPtr<MimeType> parsed = MimeType::Parse(in); ASSERT_TRUE(parsed) << "Parsing succeeded"; nsAutoString out; |