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

Unified Diff: chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util_unittest.cc

Issue 2464333003: arc: Add utility functions to implement ARC content file system (Closed)
Patch Set: Address comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util_unittest.cc
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util_unittest.cc b/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util_unittest.cc
index a8b4de9ca9863569ae474644aec2ccb488e4935e..0b3d16fb66549ad09290419b95582e85751d1c3f 100644
--- a/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util_unittest.cc
+++ b/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util_unittest.cc
@@ -4,13 +4,15 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h"
+#include "chrome/browser/chromeos/fileapi/external_file_url_util.h"
#include "content/public/common/url_constants.h"
+#include "storage/browser/fileapi/file_system_url.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace arc {
-TEST(ArcContentFileSystemUrlUtilTest, EncodeAndDecode) {
+TEST(ArcContentFileSystemUrlUtilTest, EncodeAndDecodeExternalFileUrl) {
{
GURL src("file://foo/bar/baz");
GURL dest = ArcUrlToExternalFileUrl(src);
@@ -62,4 +64,18 @@ TEST(ArcContentFileSystemUrlUtilTest, EncodeAndDecode) {
}
}
+TEST(ArcContentFileSystemUrlUtilTest, FileSystemUrlToArcUrl) {
+ GURL arc_url("content://org.chromium.foo/bar/baz");
+
+ base::FilePath path =
+ base::FilePath(kMountPointPath)
+ .Append(base::FilePath::FromUTF8Unsafe(EscapeArcUrl(arc_url)));
+ storage::FileSystemURL file_system_url =
+ storage::FileSystemURL::CreateForTest(GURL(), // origin
+ storage::kFileSystemTypeArcContent,
+ path);
+
+ EXPECT_EQ(arc_url, FileSystemUrlToArcUrl(file_system_url));
+}
+
} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698