| Index: net/base/mime_sniffer_unittest.cc
|
| diff --git a/net/base/mime_sniffer_unittest.cc b/net/base/mime_sniffer_unittest.cc
|
| index a4bde0faf636fd494b4c6b069eaafc4dd66037be..7865350d3ce164ce86578c3eb336e171c00cd84a 100644
|
| --- a/net/base/mime_sniffer_unittest.cc
|
| +++ b/net/base/mime_sniffer_unittest.cc
|
| @@ -304,13 +304,14 @@ TEST(MimeSnifferTest, FlashTest) {
|
| TEST(MimeSnifferTest, XMLTest) {
|
| // An easy feed to identify.
|
| EXPECT_EQ("application/atom+xml",
|
| - SniffMimeType("<?xml?><feed", "", "text/xml"));
|
| + SniffMimeType("<?xml?><feed", std::string(), "text/xml"));
|
| // Don't sniff out of plain text.
|
| EXPECT_EQ("text/plain",
|
| - SniffMimeType("<?xml?><feed", "", "text/plain"));
|
| + SniffMimeType("<?xml?><feed", std::string(), "text/plain"));
|
| // Simple RSS.
|
| EXPECT_EQ("application/rss+xml",
|
| - SniffMimeType("<?xml version='1.0'?>\r\n<rss", "", "text/xml"));
|
| + SniffMimeType(
|
| + "<?xml version='1.0'?>\r\n<rss", std::string(), "text/xml"));
|
|
|
| // The top of CNN's RSS feed, which we'd like to recognize as RSS.
|
| static const char kCNNRSS[] =
|
| @@ -323,39 +324,43 @@ TEST(MimeSnifferTest, XMLTest) {
|
| "version=\"2.0\">";
|
| // CNN's RSS
|
| EXPECT_EQ("application/rss+xml",
|
| - SniffMimeType(kCNNRSS, "", "text/xml"));
|
| - EXPECT_EQ("text/plain",
|
| - SniffMimeType(kCNNRSS, "", "text/plain"));
|
| + SniffMimeType(kCNNRSS, std::string(), "text/xml"));
|
| + EXPECT_EQ("text/plain", SniffMimeType(kCNNRSS, std::string(), "text/plain"));
|
|
|
| // Don't sniff random XML as something different.
|
| EXPECT_EQ("text/xml",
|
| - SniffMimeType("<?xml?><notafeed", "", "text/xml"));
|
| + SniffMimeType("<?xml?><notafeed", std::string(), "text/xml"));
|
| // Don't sniff random plain-text as something different.
|
| EXPECT_EQ("text/plain",
|
| - SniffMimeType("<?xml?><notafeed", "", "text/plain"));
|
| + SniffMimeType("<?xml?><notafeed", std::string(), "text/plain"));
|
|
|
| // Positive test for the two instances we upgrade to XHTML.
|
| EXPECT_EQ("application/xhtml+xml",
|
| SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
|
| - "", "text/xml"));
|
| + std::string(),
|
| + "text/xml"));
|
| EXPECT_EQ("application/xhtml+xml",
|
| SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
|
| - "", "application/xml"));
|
| + std::string(),
|
| + "application/xml"));
|
|
|
| // Following our behavior with HTML, don't call other mime types XHTML.
|
| EXPECT_EQ("text/plain",
|
| SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
|
| - "", "text/plain"));
|
| + std::string(),
|
| + "text/plain"));
|
| EXPECT_EQ("application/rss+xml",
|
| SniffMimeType("<html xmlns=\"http://www.w3.org/1999/xhtml\">",
|
| - "", "application/rss+xml"));
|
| + std::string(),
|
| + "application/rss+xml"));
|
|
|
| // Don't sniff other HTML-looking bits as HTML.
|
| EXPECT_EQ("text/xml",
|
| - SniffMimeType("<html><head>", "", "text/xml"));
|
| + SniffMimeType("<html><head>", std::string(), "text/xml"));
|
| EXPECT_EQ("text/xml",
|
| SniffMimeType("<foo><html xmlns=\"http://www.w3.org/1999/xhtml\">",
|
| - "", "text/xml"));
|
| + std::string(),
|
| + "text/xml"));
|
|
|
| }
|
|
|
|
|