Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Side by Side Diff: components/drive/drive_test_util.h

Issue 1246753003: Move a subset of chrome/browser/chromeos/drive into components/drive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_TEST_UTIL_H_ 5 #ifndef COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_TEST_UTIL_H_ 6 #define COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/public/test/test_utils.h" 10 #include "content/public/test/test_utils.h"
11 #include "google_apis/drive/test_util.h" 11 #include "google_apis/drive/test_util.h"
12 #include "net/base/completion_callback.h" 12 #include "net/base/completion_callback.h"
13 #include "net/base/io_buffer.h" 13 #include "net/base/io_buffer.h"
14 #include "net/base/network_change_notifier.h" 14 #include "net/base/network_change_notifier.h"
15 #include "net/base/test_completion_callback.h" 15 #include "net/base/test_completion_callback.h"
16 #if defined(OS_CHROMEOS)
16 #include "third_party/cros_system_api/constants/cryptohome.h" 17 #include "third_party/cros_system_api/constants/cryptohome.h"
18 #endif
17 19
18 class PrefRegistrySimple; 20 class PrefRegistrySimple;
19 21
20 namespace net { 22 namespace net {
21 class IOBuffer; 23 class IOBuffer;
22 } // namespace net 24 } // namespace net
23 25
24 namespace drive { 26 namespace drive {
25 27
26 namespace test_util { 28 namespace test_util {
27 29
28 // Disk space size used by FakeFreeDiskSpaceGetter. 30 // Disk space size used by FakeFreeDiskSpaceGetter.
31 #if defined(OS_CHROMEOS)
29 const int64 kLotsOfSpace = cryptohome::kMinFreeSpaceInBytes * 10; 32 const int64 kLotsOfSpace = cryptohome::kMinFreeSpaceInBytes * 10;
33 #else
34 const int64 kLotsOfSpace = 3ul * 1024ul * 1024ul * 1024ul; // 3GB
Łukasz Anforowicz 2015/07/22 17:25:54 Replying to mtomasz@'s comment from crrev.com/1215
hashimoto 2015/07/23 06:01:15 nit: cryptohome::kMinFreeSpaceInBytes*10 = 5GB. I
Łukasz Anforowicz 2015/07/27 17:53:27 Done. Initially I shied away from values greater
35 #endif
30 36
31 // Helper to destroy objects which needs Destroy() to be called on destruction. 37 // Helper to destroy objects which needs Destroy() to be called on destruction.
32 // Note: When using this helper, you should destruct objects before 38 // Note: When using this helper, you should destruct objects before
33 // BrowserThread. 39 // BrowserThread.
34 struct DestroyHelperForTests { 40 struct DestroyHelperForTests {
35 template<typename T> 41 template<typename T>
36 void operator()(T* object) const { 42 void operator()(T* object) const {
37 if (object) { 43 if (object) {
38 object->Destroy(); 44 object->Destroy();
39 content::RunAllBlockingPoolTasksUntilIdle(); // Finish destruction. 45 content::RunAllBlockingPoolTasksUntilIdle(); // Finish destruction.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // NetworkChangeNotifier override. 80 // NetworkChangeNotifier override.
75 ConnectionType GetCurrentConnectionType() const override; 81 ConnectionType GetCurrentConnectionType() const override;
76 82
77 private: 83 private:
78 net::NetworkChangeNotifier::ConnectionType type_; 84 net::NetworkChangeNotifier::ConnectionType type_;
79 }; 85 };
80 86
81 } // namespace test_util 87 } // namespace test_util
82 } // namespace drive 88 } // namespace drive
83 89
84 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_TEST_UTIL_H_ 90 #endif // COMPONENTS_DRIVE_DRIVE_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698