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

Unified Diff: chrome/browser/chromeos/drive/test_util.h

Issue 1208963003: Move GN obj files to target-specific dirs (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/drive/sync_client_unittest.cc ('k') | chrome/browser/chromeos/drive/test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/test_util.h
diff --git a/chrome/browser/chromeos/drive/test_util.h b/chrome/browser/chromeos/drive/test_util.h
deleted file mode 100644
index 2e418a8b1aae86bafbbb8693171cee3da401ace3..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/drive/test_util.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_
-#define CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_
-
-#include <string>
-
-#include "content/public/test/test_utils.h"
-#include "google_apis/drive/test_util.h"
-#include "net/base/completion_callback.h"
-#include "net/base/io_buffer.h"
-#include "net/base/network_change_notifier.h"
-#include "net/base/test_completion_callback.h"
-#include "third_party/cros_system_api/constants/cryptohome.h"
-
-class PrefRegistrySimple;
-
-namespace net {
-class IOBuffer;
-} // namespace net
-
-namespace drive {
-
-namespace test_util {
-
-// Disk space size used by FakeFreeDiskSpaceGetter.
-const int64 kLotsOfSpace = cryptohome::kMinFreeSpaceInBytes * 10;
-
-// Helper to destroy objects which needs Destroy() to be called on destruction.
-// Note: When using this helper, you should destruct objects before
-// BrowserThread.
-struct DestroyHelperForTests {
- template<typename T>
- void operator()(T* object) const {
- if (object) {
- object->Destroy();
- content::RunAllBlockingPoolTasksUntilIdle(); // Finish destruction.
- }
- }
-};
-
-// Reads all the data from |reader| and copies to |content|. Returns net::Error
-// code.
-template<typename Reader>
-int ReadAllData(Reader* reader, std::string* content) {
- const int kBufferSize = 10;
- scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(kBufferSize));
- while (true) {
- net::TestCompletionCallback callback;
- int result = reader->Read(buffer.get(), kBufferSize, callback.callback());
- result = callback.GetResult(result);
- if (result <= 0) {
- // Found an error or EOF. Return it. Note: net::OK is 0.
- return result;
- }
- content->append(buffer->data(), result);
- }
-}
-
-// Registers Drive related preferences in |pref_registry|. Drive related
-// preferences should be registered as TestingPrefServiceSimple will crash if
-// unregistered preference is referenced.
-void RegisterDrivePrefs(PrefRegistrySimple* pref_registry);
-
-// Fake NetworkChangeNotifier implementation.
-class FakeNetworkChangeNotifier : public net::NetworkChangeNotifier {
- public:
- FakeNetworkChangeNotifier();
-
- void SetConnectionType(ConnectionType type);
-
- // NetworkChangeNotifier override.
- ConnectionType GetCurrentConnectionType() const override;
-
- private:
- net::NetworkChangeNotifier::ConnectionType type_;
-};
-
-} // namespace test_util
-} // namespace drive
-
-#endif // CHROME_BROWSER_CHROMEOS_DRIVE_TEST_UTIL_H_
« no previous file with comments | « chrome/browser/chromeos/drive/sync_client_unittest.cc ('k') | chrome/browser/chromeos/drive/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698