Index: components/drive/file_system/download_operation_unittest.cc |
diff --git a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc b/components/drive/file_system/download_operation_unittest.cc |
similarity index 96% |
rename from chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc |
rename to components/drive/file_system/download_operation_unittest.cc |
index ea595830994b98c21345431c51af8c2872150d8a..f6f0a599b01635c83a329b1f2901b37db9721418 100644 |
--- a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc |
+++ b/components/drive/file_system/download_operation_unittest.cc |
@@ -2,25 +2,37 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/chromeos/drive/file_system/download_operation.h" |
+#include "components/drive/file_system/download_operation.h" |
#include "base/files/file_util.h" |
#include "base/task_runner_util.h" |
-#include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h" |
-#include "chrome/browser/chromeos/drive/file_cache.h" |
-#include "chrome/browser/chromeos/drive/file_change.h" |
-#include "chrome/browser/chromeos/drive/file_system/operation_test_base.h" |
-#include "chrome/browser/chromeos/drive/file_system_core_util.h" |
-#include "chrome/browser/chromeos/drive/job_scheduler.h" |
+#include "components/drive/fake_free_disk_space_getter.h" |
+#include "components/drive/file_cache.h" |
+#include "components/drive/file_change.h" |
+#include "components/drive/file_system/operation_test_base.h" |
+#include "components/drive/file_system_core_util.h" |
+#include "components/drive/job_scheduler.h" |
#include "components/drive/service/fake_drive_service.h" |
#include "content/public/test/test_utils.h" |
#include "google_apis/drive/test_util.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#if defined(OS_CHROMEOS) |
#include "third_party/cros_system_api/constants/cryptohome.h" |
+#endif |
namespace drive { |
namespace file_system { |
+namespace { |
+ |
+#if defined(OS_CHROMEOS) |
+const int64 kMinFreeSpaceInBytes = cryptohome::kMinFreeSpaceInBytes; |
+#else |
+const int64 kMinFreeSpaceInBytes = 512 * 1LL << 20; |
mtomasz
2015/07/02 07:36:34
It's quite cryptic. Can we use 512 * 1024 * 1024 i
|
+#endif |
+ |
+} // namespace |
+ |
class DownloadOperationTest : public OperationTestBase { |
protected: |
void SetUp() override { |
@@ -43,7 +55,7 @@ TEST_F(DownloadOperationTest, |
// Pretend we have enough space. |
fake_free_disk_space_getter()->set_default_value( |
- file_size + cryptohome::kMinFreeSpaceInBytes); |
+ file_size + kMinFreeSpaceInBytes); |
FileError error = FILE_ERROR_FAILED; |
base::FilePath file_path; |
@@ -119,7 +131,7 @@ TEST_F(DownloadOperationTest, |
// but then start reporting we have space. This is to emulate that |
// the disk space was freed up by removing temporary files. |
fake_free_disk_space_getter()->set_default_value( |
- file_size + cryptohome::kMinFreeSpaceInBytes); |
+ file_size + kMinFreeSpaceInBytes); |
fake_free_disk_space_getter()->PushFakeValue(0); |
operation_->EnsureFileDownloadedByPath( |
@@ -161,9 +173,9 @@ TEST_F(DownloadOperationTest, |
// the disk space becomes full after the file is downloaded for some reason |
// (ex. the actual file was larger than the expected size). |
fake_free_disk_space_getter()->PushFakeValue( |
- file_size + cryptohome::kMinFreeSpaceInBytes); |
+ file_size + kMinFreeSpaceInBytes); |
fake_free_disk_space_getter()->set_default_value( |
- cryptohome::kMinFreeSpaceInBytes - 1); |
+ kMinFreeSpaceInBytes - 1); |
FileError error = FILE_ERROR_OK; |
base::FilePath file_path; |