Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: net/base/mime_util_unittest.cc

Issue 10834383: Chrome OS "open with" picker allowing Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tiny 80 chars fix Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "net/base/mime_util.h" 7 #include "net/base/mime_util.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 EXPECT_TRUE(IsSupportedMimeType("image/jpeg")); 73 EXPECT_TRUE(IsSupportedMimeType("image/jpeg"));
74 EXPECT_FALSE(IsSupportedMimeType("image/lolcat")); 74 EXPECT_FALSE(IsSupportedMimeType("image/lolcat"));
75 EXPECT_TRUE(IsSupportedMimeType("text/html")); 75 EXPECT_TRUE(IsSupportedMimeType("text/html"));
76 EXPECT_TRUE(IsSupportedMimeType("text/banana")); 76 EXPECT_TRUE(IsSupportedMimeType("text/banana"));
77 EXPECT_FALSE(IsSupportedMimeType("text/vcard")); 77 EXPECT_FALSE(IsSupportedMimeType("text/vcard"));
78 EXPECT_FALSE(IsSupportedMimeType("application/virus")); 78 EXPECT_FALSE(IsSupportedMimeType("application/virus"));
79 } 79 }
80 80
81 TEST(MimeUtilTest, MatchesMimeType) { 81 TEST(MimeUtilTest, MatchesMimeType) {
82 EXPECT_TRUE(MatchesMimeType("*", "video/x-mpeg")); 82 EXPECT_TRUE(MatchesMimeType("*", "video/x-mpeg"));
83 EXPECT_TRUE(MatchesMimeType("*", ""));
83 EXPECT_TRUE(MatchesMimeType("video/*", "video/x-mpeg")); 84 EXPECT_TRUE(MatchesMimeType("video/*", "video/x-mpeg"));
84 EXPECT_TRUE(MatchesMimeType("video/x-mpeg", "video/x-mpeg")); 85 EXPECT_TRUE(MatchesMimeType("video/x-mpeg", "video/x-mpeg"));
85 EXPECT_TRUE(MatchesMimeType("application/*+xml", 86 EXPECT_TRUE(MatchesMimeType("application/*+xml",
86 "application/html+xml")); 87 "application/html+xml"));
87 EXPECT_TRUE(MatchesMimeType("application/*+xml", "application/+xml")); 88 EXPECT_TRUE(MatchesMimeType("application/*+xml", "application/+xml"));
88 EXPECT_TRUE(MatchesMimeType("aaa*aaa", "aaaaaa")); 89 EXPECT_TRUE(MatchesMimeType("aaa*aaa", "aaaaaa"));
89 EXPECT_FALSE(MatchesMimeType("video/", "video/x-mpeg")); 90 EXPECT_FALSE(MatchesMimeType("video/", "video/x-mpeg"));
90 EXPECT_FALSE(MatchesMimeType("", "video/x-mpeg")); 91 EXPECT_FALSE(MatchesMimeType("", "video/x-mpeg"));
91 EXPECT_FALSE(MatchesMimeType("", "")); 92 EXPECT_FALSE(MatchesMimeType("", ""));
92 EXPECT_FALSE(MatchesMimeType("video/x-mpeg", "")); 93 EXPECT_FALSE(MatchesMimeType("video/x-mpeg", ""));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 EXPECT_EQ("example", GetIANAMediaType("example/yomomma")); 180 EXPECT_EQ("example", GetIANAMediaType("example/yomomma"));
180 EXPECT_EQ("image", GetIANAMediaType("image/png")); 181 EXPECT_EQ("image", GetIANAMediaType("image/png"));
181 EXPECT_EQ("message", GetIANAMediaType("message/sipfrag")); 182 EXPECT_EQ("message", GetIANAMediaType("message/sipfrag"));
182 EXPECT_EQ("model", GetIANAMediaType("model/vrml")); 183 EXPECT_EQ("model", GetIANAMediaType("model/vrml"));
183 EXPECT_EQ("multipart", GetIANAMediaType("multipart/mixed")); 184 EXPECT_EQ("multipart", GetIANAMediaType("multipart/mixed"));
184 EXPECT_EQ("text", GetIANAMediaType("text/plain")); 185 EXPECT_EQ("text", GetIANAMediaType("text/plain"));
185 EXPECT_EQ("video", GetIANAMediaType("video/H261")); 186 EXPECT_EQ("video", GetIANAMediaType("video/H261"));
186 } 187 }
187 188
188 } // namespace net 189 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698