OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/file_manager/path_util.h" | 5 #include "chrome/browser/chromeos/file_manager/path_util.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 9 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
10 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 10 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 EXPECT_TRUE(ConvertPathToArcUrl( | 93 EXPECT_TRUE(ConvertPathToArcUrl( |
94 base::FilePath::FromUTF8Unsafe("/media/removable/a/b/c"), &url)); | 94 base::FilePath::FromUTF8Unsafe("/media/removable/a/b/c"), &url)); |
95 EXPECT_EQ(GURL("content://org.chromium.arc.removablemediaprovider/a/b/c"), | 95 EXPECT_EQ(GURL("content://org.chromium.arc.removablemediaprovider/a/b/c"), |
96 url); | 96 url); |
97 | 97 |
98 EXPECT_FALSE(ConvertPathToArcUrl( | 98 EXPECT_FALSE(ConvertPathToArcUrl( |
99 base::FilePath::FromUTF8Unsafe("/media/removable_foobar"), &url)); | 99 base::FilePath::FromUTF8Unsafe("/media/removable_foobar"), &url)); |
100 | 100 |
101 // Conversion of paths under the primary profile's downloads folder. | 101 // Conversion of paths under the primary profile's downloads folder. |
102 const base::FilePath downloads = GetDownloadsFolderForProfile( | 102 const base::FilePath downloads = GetDownloadsFolderForProfile( |
103 chromeos::ProfileHelper::Get()->GetProfileByUserIdHash( | 103 chromeos::ProfileHelper::Get()->GetProfileByUserIdHashForTest( |
104 "user@gmail.com-hash")); | 104 "user@gmail.com-hash")); |
105 EXPECT_TRUE(ConvertPathToArcUrl(downloads.AppendASCII("a/b/c"), &url)); | 105 EXPECT_TRUE(ConvertPathToArcUrl(downloads.AppendASCII("a/b/c"), &url)); |
106 EXPECT_EQ(GURL("file:///sdcard/Download/a/b/c"), url); | 106 EXPECT_EQ(GURL("file:///sdcard/Download/a/b/c"), url); |
107 | 107 |
108 // Non-primary profile's downloads folder is not supported for ARC yet. | 108 // Non-primary profile's downloads folder is not supported for ARC yet. |
109 const base::FilePath downloads2 = GetDownloadsFolderForProfile( | 109 const base::FilePath downloads2 = GetDownloadsFolderForProfile( |
110 chromeos::ProfileHelper::Get()->GetProfileByUserIdHash( | 110 chromeos::ProfileHelper::Get()->GetProfileByUserIdHashForTest( |
111 "user2@gmail.com-hash")); | 111 "user2@gmail.com-hash")); |
112 EXPECT_FALSE(ConvertPathToArcUrl(downloads2.AppendASCII("a/b/c"), &url)); | 112 EXPECT_FALSE(ConvertPathToArcUrl(downloads2.AppendASCII("a/b/c"), &url)); |
113 } | 113 } |
114 | 114 |
115 } // namespace | 115 } // namespace |
116 } // namespace util | 116 } // namespace util |
117 } // namespace file_manager | 117 } // namespace file_manager |
OLD | NEW |