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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/operations/unmount_unittest.cc

Issue 335753004: [fsp] Cleanup handling errors for operation requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 unmount.OnSuccess(kRequestId, 156 unmount.OnSuccess(kRequestId,
157 scoped_ptr<RequestValue>(new RequestValue()), 157 scoped_ptr<RequestValue>(new RequestValue()),
158 false /* has_more */); 158 false /* has_more */);
159 ASSERT_EQ(1u, callback_logger.events().size()); 159 ASSERT_EQ(1u, callback_logger.events().size());
160 base::File::Error event_result = callback_logger.events()[0]; 160 base::File::Error event_result = callback_logger.events()[0];
161 EXPECT_EQ(base::File::FILE_OK, event_result); 161 EXPECT_EQ(base::File::FILE_OK, event_result);
162 } 162 }
163 163
164 TEST_F(FileSystemProviderOperationsUnmountTest, OnError) { 164 TEST_F(FileSystemProviderOperationsUnmountTest, OnError) {
165 using extensions::api::file_system_provider_internal::UnmountRequestedError::
166 Params;
167
168 LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); 165 LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */);
169 CallbackLogger callback_logger; 166 CallbackLogger callback_logger;
170 167
171 Unmount unmount( 168 Unmount unmount(
172 NULL, 169 NULL,
173 file_system_info_, 170 file_system_info_,
174 base::Bind(&CallbackLogger::OnUnmount, callback_logger.GetWeakPtr())); 171 base::Bind(&CallbackLogger::OnUnmount, callback_logger.GetWeakPtr()));
175 unmount.SetDispatchEventImplForTesting( 172 unmount.SetDispatchEventImplForTesting(
176 base::Bind(&LoggingDispatchEventImpl::OnDispatchEventImpl, 173 base::Bind(&LoggingDispatchEventImpl::OnDispatchEventImpl,
177 base::Unretained(&dispatcher))); 174 base::Unretained(&dispatcher)));
178 175
179 EXPECT_TRUE(unmount.Execute(kRequestId)); 176 EXPECT_TRUE(unmount.Execute(kRequestId));
180 177
181 unmount.OnError(kRequestId, base::File::FILE_ERROR_NOT_FOUND); 178 unmount.OnError(kRequestId,
179 scoped_ptr<RequestValue>(new RequestValue()),
180 base::File::FILE_ERROR_NOT_FOUND);
182 ASSERT_EQ(1u, callback_logger.events().size()); 181 ASSERT_EQ(1u, callback_logger.events().size());
183 base::File::Error event_result = callback_logger.events()[0]; 182 base::File::Error event_result = callback_logger.events()[0];
184 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, event_result); 183 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, event_result);
185 } 184 }
186 185
187 } // namespace operations 186 } // namespace operations
188 } // namespace file_system_provider 187 } // namespace file_system_provider
189 } // namespace chromeos 188 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698