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

Side by Side Diff: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util_unittest.cc

Issue 2661003003: mediaview: Recognize more MIME types. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h" 6 #include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h"
7 #include "storage/browser/fileapi/file_system_url.h" 7 #include "storage/browser/fileapi/file_system_url.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 TEST(ArcDocumentsProviderUtilTest, BuildDocumentUrl) { 192 TEST(ArcDocumentsProviderUtilTest, BuildDocumentUrl) {
193 EXPECT_EQ("content://authority/document/document_id", 193 EXPECT_EQ("content://authority/document/document_id",
194 BuildDocumentUrl("authority", "document_id").spec()); 194 BuildDocumentUrl("authority", "document_id").spec());
195 EXPECT_EQ("content://a%20b/document/a%20b", 195 EXPECT_EQ("content://a%20b/document/a%20b",
196 BuildDocumentUrl("a b", "a b").spec()); 196 BuildDocumentUrl("a b", "a b").spec());
197 EXPECT_EQ("content://a%2Fb/document/a%2Fb", 197 EXPECT_EQ("content://a%2Fb/document/a%2Fb",
198 BuildDocumentUrl("a/b", "a/b").spec()); 198 BuildDocumentUrl("a/b", "a/b").spec());
199 EXPECT_EQ("content://../document/..", BuildDocumentUrl("..", "..").spec()); 199 EXPECT_EQ("content://../document/..", BuildDocumentUrl("..", "..").spec());
200 } 200 }
201 201
202 TEST(ArcDocumentsProviderUtilTest, GetExtensionsForArcMimeType) {
203 // MIME types already known to Chromium.
204 EXPECT_NE(0u, GetExtensionsForArcMimeType("audio/mp3").size());
205 EXPECT_NE(0u, GetExtensionsForArcMimeType("image/jpeg").size());
206 EXPECT_NE(0u, GetExtensionsForArcMimeType("text/html").size());
207 EXPECT_NE(
208 0u, GetExtensionsForArcMimeType("application/x-chrome-extension").size());
209
210 // MIME types known to Android only.
211 EXPECT_NE(0u,
212 GetExtensionsForArcMimeType("application/x-android-drm-fl").size());
213 EXPECT_NE(0u, GetExtensionsForArcMimeType("audio/x-wav").size());
214
215 // Unknown types.
216 EXPECT_EQ(0u, GetExtensionsForArcMimeType("abc/xyz").size());
217 EXPECT_EQ(
218 0u, GetExtensionsForArcMimeType("vnd.android.document/directory").size());
219
220 // Specially handled types.
221 EXPECT_EQ(0u, GetExtensionsForArcMimeType("application/octet-stream").size());
222 }
223
202 } // namespace 224 } // namespace
203 225
204 } // namespace arc 226 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698