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

Side by Side Diff: chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc

Issue 23537020: Fixes FileSystemOperation::Cancel behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | webkit/browser/fileapi/file_system_operation_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 URL(kFile), false /* exclusive */, 379 URL(kFile), false /* exclusive */,
380 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); 380 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
381 base::MessageLoop::current()->RunUntilIdle(); 381 base::MessageLoop::current()->RunUntilIdle();
382 EXPECT_EQ(1, callback_count_); 382 EXPECT_EQ(1, callback_count_);
383 383
384 // Run Truncate and immediately cancel. This shouldn't crash. 384 // Run Truncate and immediately cancel. This shouldn't crash.
385 ResetCallbackStatus(); 385 ResetCallbackStatus();
386 fileapi::FileSystemOperationRunner::OperationID id = 386 fileapi::FileSystemOperationRunner::OperationID id =
387 file_system_.operation_runner()->Truncate( 387 file_system_.operation_runner()->Truncate(
388 URL(kFile), 10, 388 URL(kFile), 10,
389 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_ABORT)); 389 ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
390 file_system_.operation_runner()->Cancel( 390 file_system_.operation_runner()->Cancel(
391 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK)); 391 id, ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_INVALID_OPERATION));
392 base::MessageLoop::current()->RunUntilIdle(); 392 base::MessageLoop::current()->RunUntilIdle();
393 EXPECT_EQ(2, callback_count_); 393 EXPECT_EQ(2, callback_count_);
394 } 394 }
395 395
396 } // namespace sync_file_system 396 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | webkit/browser/fileapi/file_system_operation_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698