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

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

Issue 2914433002: arc: Use the MIME type returned by the container to handle content URLs (Closed)
Patch Set: Comment drop. Created 3 years, 6 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 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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h " 6 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h "
7 #include "chrome/browser/chromeos/fileapi/external_file_url_util.h" 7 #include "chrome/browser/chromeos/fileapi/external_file_url_util.h"
8 #include "content/public/common/url_constants.h" 8 #include "content/public/common/url_constants.h"
9 #include "storage/browser/fileapi/file_system_url.h" 9 #include "storage/browser/fileapi/file_system_url.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 base::FilePath(kContentFileSystemMountPointPath) 71 base::FilePath(kContentFileSystemMountPointPath)
72 .Append(base::FilePath::FromUTF8Unsafe(EscapeArcUrl(arc_url))); 72 .Append(base::FilePath::FromUTF8Unsafe(EscapeArcUrl(arc_url)));
73 storage::FileSystemURL file_system_url = 73 storage::FileSystemURL file_system_url =
74 storage::FileSystemURL::CreateForTest(GURL(), // origin 74 storage::FileSystemURL::CreateForTest(GURL(), // origin
75 storage::kFileSystemTypeArcContent, 75 storage::kFileSystemTypeArcContent,
76 path); 76 path);
77 77
78 EXPECT_EQ(arc_url, FileSystemUrlToArcUrl(file_system_url)); 78 EXPECT_EQ(arc_url, FileSystemUrlToArcUrl(file_system_url));
79 } 79 }
80 80
81 TEST(ArcContentFileSystemUrlUtilTest, PathToArcUrl) {
82 GURL arc_url("content://org.chromium.foo/bar/baz");
83
84 base::FilePath path =
85 base::FilePath(kContentFileSystemMountPointPath)
86 .Append(base::FilePath::FromUTF8Unsafe(EscapeArcUrl(arc_url)));
87 EXPECT_EQ(arc_url, PathToArcUrl(path));
88 }
89
81 } // namespace arc 90 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698