| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/drive/file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "webkit/browser/fileapi/external_mount_points.h" |
| 14 #include "webkit/browser/fileapi/file_system_mount_point_provider.h" | 15 #include "webkit/browser/fileapi/file_system_mount_point_provider.h" |
| 15 #include "webkit/fileapi/external_mount_points.h" | 16 #include "webkit/browser/fileapi/file_system_task_runners.h" |
| 17 #include "webkit/browser/fileapi/isolated_context.h" |
| 18 #include "webkit/browser/fileapi/mock_file_system_options.h" |
| 16 #include "webkit/fileapi/file_system_context.h" | 19 #include "webkit/fileapi/file_system_context.h" |
| 17 #include "webkit/fileapi/file_system_task_runners.h" | |
| 18 #include "webkit/fileapi/file_system_url.h" | 20 #include "webkit/fileapi/file_system_url.h" |
| 19 #include "webkit/fileapi/isolated_context.h" | |
| 20 #include "webkit/fileapi/mock_file_system_options.h" | |
| 21 | 21 |
| 22 namespace drive { | 22 namespace drive { |
| 23 namespace util { | 23 namespace util { |
| 24 | 24 |
| 25 TEST(FileSystemUtilTest, FilePathToDriveURL) { | 25 TEST(FileSystemUtilTest, FilePathToDriveURL) { |
| 26 base::FilePath path; | 26 base::FilePath path; |
| 27 | 27 |
| 28 // Path with alphabets and numbers. | 28 // Path with alphabets and numbers. |
| 29 path = GetDriveMyDriveRootPath().AppendASCII("foo/bar012.txt"); | 29 path = GetDriveMyDriveRootPath().AppendASCII("foo/bar012.txt"); |
| 30 EXPECT_EQ(path, DriveURLToFilePath(FilePathToDriveURL(path))); | 30 EXPECT_EQ(path, DriveURLToFilePath(FilePathToDriveURL(path))); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 std::string data = "Hello world!"; | 321 std::string data = "Hello world!"; |
| 322 EXPECT_EQ(static_cast<int>(data.size()), | 322 EXPECT_EQ(static_cast<int>(data.size()), |
| 323 file_util::WriteFile(file, data.data(), data.size())); | 323 file_util::WriteFile(file, data.data(), data.size())); |
| 324 EXPECT_FALSE(HasGDocFileExtension(file)); | 324 EXPECT_FALSE(HasGDocFileExtension(file)); |
| 325 EXPECT_TRUE(ReadUrlFromGDocFile(file).is_empty()); | 325 EXPECT_TRUE(ReadUrlFromGDocFile(file).is_empty()); |
| 326 EXPECT_TRUE(ReadResourceIdFromGDocFile(file).empty()); | 326 EXPECT_TRUE(ReadResourceIdFromGDocFile(file).empty()); |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace util | 329 } // namespace util |
| 330 } // namespace drive | 330 } // namespace drive |
| OLD | NEW |