| Index: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_unittest.cc
|
| diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_unittest.cc b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_unittest.cc
|
| index 80bdacd0b14465c7e77e2dbf01ee10f7a3f9c351..b6fd00a2f3bd66dc4fb5c970f315c6b819c66936 100644
|
| --- a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_unittest.cc
|
| +++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_root_unittest.cc
|
| @@ -19,6 +19,7 @@
|
| #include "content/public/test/test_browser_thread_bundle.h"
|
| #include "storage/common/fileapi/directory_entry.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include "url/gurl.h"
|
|
|
| using storage::DirectoryEntry;
|
| using EntryList = storage::AsyncFileUtil::EntryList;
|
| @@ -236,4 +237,43 @@ TEST_F(ArcDocumentsProviderRootTest, ReadDirectoryNoSuchDirectory) {
|
| run_loop.Run();
|
| }
|
|
|
| +TEST_F(ArcDocumentsProviderRootTest, ResolveToContentUrl) {
|
| + base::RunLoop run_loop;
|
| + root_->ResolveToContentUrl(
|
| + base::FilePath(FILE_PATH_LITERAL("pet/cat.png")),
|
| + base::Bind(
|
| + [](base::RunLoop* run_loop, const GURL& url) {
|
| + EXPECT_EQ(GURL("content://org.chromium.test/document/cat-id"), url);
|
| + run_loop->Quit();
|
| + },
|
| + &run_loop));
|
| + run_loop.Run();
|
| +}
|
| +
|
| +TEST_F(ArcDocumentsProviderRootTest, ResolveToContentUrlRoot) {
|
| + base::RunLoop run_loop;
|
| + root_->ResolveToContentUrl(
|
| + base::FilePath(FILE_PATH_LITERAL("")),
|
| + base::Bind(
|
| + [](base::RunLoop* run_loop, const GURL& url) {
|
| + EXPECT_EQ(GURL("content://org.chromium.test/document/root-id"),
|
| + url);
|
| + run_loop->Quit();
|
| + },
|
| + &run_loop));
|
| + run_loop.Run();
|
| +}
|
| +
|
| +TEST_F(ArcDocumentsProviderRootTest, ResolveToContentUrlNoSuchFile) {
|
| + base::RunLoop run_loop;
|
| + root_->ResolveToContentUrl(base::FilePath(FILE_PATH_LITERAL("pet/fox.jpg")),
|
| + base::Bind(
|
| + [](base::RunLoop* run_loop, const GURL& url) {
|
| + EXPECT_EQ(GURL(), url);
|
| + run_loop->Quit();
|
| + },
|
| + &run_loop));
|
| + run_loop.Run();
|
| +}
|
| +
|
| } // namespace arc
|
|
|