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

Side by Side Diff: content/public/test/test_file_error_injector.h

Issue 11366121: Split DownloadFile::Rename into RenameAndUniquify and RenameAndAnnotate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to LKGR. Created 8 years, 1 month 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 | Annotate | Revision Log
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 CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_
6 #define CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ 6 #define CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // 48 //
49 // download_manager->DownloadUrl(url1, ...); 49 // download_manager->DownloadUrl(url1, ...);
50 // download_manager->DownloadUrl(url2, ...); 50 // download_manager->DownloadUrl(url2, ...);
51 // ... wait for downloads to finish or get an injected error ... 51 // ... wait for downloads to finish or get an injected error ...
52 class TestFileErrorInjector 52 class TestFileErrorInjector
53 : public base::RefCountedThreadSafe<TestFileErrorInjector> { 53 : public base::RefCountedThreadSafe<TestFileErrorInjector> {
54 public: 54 public:
55 enum FileOperationCode { 55 enum FileOperationCode {
56 FILE_OPERATION_INITIALIZE, 56 FILE_OPERATION_INITIALIZE,
57 FILE_OPERATION_WRITE, 57 FILE_OPERATION_WRITE,
58 FILE_OPERATION_RENAME 58 FILE_OPERATION_RENAME_UNIQUIFY,
59 FILE_OPERATION_RENAME_ANNOTATE,
59 }; 60 };
60 61
61 // Structure that encapsulates the information needed to inject a file error. 62 // Structure that encapsulates the information needed to inject a file error.
62 struct FileErrorInfo { 63 struct FileErrorInfo {
63 std::string url; // Full URL of the download. Identifies the download. 64 std::string url; // Full URL of the download. Identifies the download.
64 FileOperationCode code; // Operation to affect. 65 FileOperationCode code; // Operation to affect.
65 int operation_instance; // 0-based count of operation calls, for each code. 66 int operation_instance; // 0-based count of operation calls, for each code.
66 DownloadInterruptReason error; // Error to inject. 67 DownloadInterruptReason error; // Error to inject.
67 }; 68 };
68 69
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 141
141 // The download manager we set the factory on. 142 // The download manager we set the factory on.
142 scoped_refptr<DownloadManagerImpl> download_manager_; 143 scoped_refptr<DownloadManagerImpl> download_manager_;
143 144
144 DISALLOW_COPY_AND_ASSIGN(TestFileErrorInjector); 145 DISALLOW_COPY_AND_ASSIGN(TestFileErrorInjector);
145 }; 146 };
146 147
147 } // namespace content 148 } // namespace content
148 149
149 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_ 150 #endif // CONTENT_PUBLIC_TEST_TEST_FILE_ERROR_INJECTOR_H_
OLDNEW
« no previous file with comments | « content/browser/download/mock_download_file.h ('k') | content/public/test/test_file_error_injector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698