diff options
author | mtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 06:41:12 +0000 |
---|---|---|
committer | mtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 06:41:12 +0000 |
commit | 304db10e8d36aa505910810f60daf0179ee7bbf1 (patch) | |
tree | f813d45aab3f46b152907b7f5e912ff2f6ab4e5b /chrome/browser/chromeos/file_manager/url_util_unittest.cc | |
parent | ae113f8339ed0559898ad1b26415add572740ceb (diff) | |
download | chromium_src-304db10e8d36aa505910810f60daf0179ee7bbf1.zip chromium_src-304db10e8d36aa505910810f60daf0179ee7bbf1.tar.gz chromium_src-304db10e8d36aa505910810f60daf0179ee7bbf1.tar.bz2 |
Migrate fullPaths to URLs in appState.
This patch replaces currentDirectoryPath with currentDirectoryURL, and same for the selectionPath. As a result, the entire appState does not depend on paths anymore.
TEST=browser_tests, also tested manually.
BUG=333168
Review URL: https://codereview.chromium.org/132453007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/file_manager/url_util_unittest.cc')
-rw-r--r-- | chrome/browser/chromeos/file_manager/url_util_unittest.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/chrome/browser/chromeos/file_manager/url_util_unittest.cc b/chrome/browser/chromeos/file_manager/url_util_unittest.cc index cd24c18..20ad4ee 100644 --- a/chrome/browser/chromeos/file_manager/url_util_unittest.cc +++ b/chrome/browser/chromeos/file_manager/url_util_unittest.cc @@ -43,8 +43,9 @@ TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrlWithParams_NoFileTypes) { const GURL url = GetFileManagerMainPageUrlWithParams( ui::SelectFileDialog::SELECT_OPEN_FILE, base::UTF8ToUTF16("some title"), - base::FilePath::FromUTF8Unsafe("/Downloads"), - base::FilePath::FromUTF8Unsafe("/Downloads/foo.txt"), + GURL("filesystem:chrome-extension://abc/Downloads/"), + GURL("filesystem:chrome-extension://abc/Downloads/foo.txt"), + "foo.txt", NULL, // No file types 0, // Hence no file type index. FILE_PATH_LITERAL("txt")); @@ -56,9 +57,11 @@ TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrlWithParams_NoFileTypes) { EXPECT_TRUE(url.query().find("%20") != std::string::npos); // The escaped query is hard to read. Pretty print the escaped JSON. EXPECT_EQ("{\n" - " \"currentDirectoryPath\": \"/Downloads\",\n" + " \"currentDirectoryURL\": " + "\"filesystem:chrome-extension://abc/Downloads/\",\n" " \"defaultExtension\": \"txt\",\n" - " \"selectionPath\": \"/Downloads/foo.txt\",\n" + " \"selectionURL\": " + "\"filesystem:chrome-extension://abc/Downloads/foo.txt\",\n" " \"shouldReturnLocalPath\": true,\n" " \"targetName\": \"foo.txt\",\n" " \"title\": \"some title\",\n" @@ -88,8 +91,9 @@ TEST(FileManagerUrlUtilTest, const GURL url = GetFileManagerMainPageUrlWithParams( ui::SelectFileDialog::SELECT_OPEN_FILE, base::UTF8ToUTF16("some title"), - base::FilePath::FromUTF8Unsafe("/Downloads"), - base::FilePath::FromUTF8Unsafe("/Downloads/foo.txt"), + GURL("filesystem:chrome-extension://abc/Downloads/"), + GURL("filesystem:chrome-extension://abc/Downloads/foo.txt"), + "foo.txt", &file_types, 1, // The file type index is 1-based. FILE_PATH_LITERAL("txt")); @@ -101,10 +105,12 @@ TEST(FileManagerUrlUtilTest, EXPECT_TRUE(url.query().find("%20") != std::string::npos); // The escaped query is hard to read. Pretty print the escaped JSON. EXPECT_EQ("{\n" - " \"currentDirectoryPath\": \"/Downloads\",\n" + " \"currentDirectoryURL\": " + "\"filesystem:chrome-extension://abc/Downloads/\",\n" " \"defaultExtension\": \"txt\",\n" " \"includeAllFiles\": false,\n" - " \"selectionPath\": \"/Downloads/foo.txt\",\n" + " \"selectionURL\": " + "\"filesystem:chrome-extension://abc/Downloads/foo.txt\",\n" " \"shouldReturnLocalPath\": false,\n" " \"targetName\": \"foo.txt\",\n" " \"title\": \"some title\",\n" |