| OLD | NEW | 
|---|
| 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/files/file.h" | 9 #include "base/files/file.h" | 
| 10 #include "base/location.h" | 10 #include "base/location.h" | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 58         callback_count_(0), | 58         callback_count_(0), | 
| 59         write_status_(File::FILE_ERROR_FAILED), | 59         write_status_(File::FILE_ERROR_FAILED), | 
| 60         write_bytes_(0), | 60         write_bytes_(0), | 
| 61         write_complete_(false), | 61         write_complete_(false), | 
| 62         url_request_context_(file_system_.file_system_context()), | 62         url_request_context_(file_system_.file_system_context()), | 
| 63         weak_factory_(this) {} | 63         weak_factory_(this) {} | 
| 64 | 64 | 
| 65   virtual void SetUp() OVERRIDE { | 65   virtual void SetUp() OVERRIDE { | 
| 66     ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 66     ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 
| 67 | 67 | 
| 68     file_system_.SetUp(); | 68     file_system_.SetUp(CannedSyncableFileSystem::QUOTA_ENABLED); | 
| 69     sync_context_ = new LocalFileSyncContext( | 69     sync_context_ = new LocalFileSyncContext( | 
| 70         dir_.path(), | 70         dir_.path(), | 
| 71         in_memory_env_.get(), | 71         in_memory_env_.get(), | 
| 72         base::MessageLoopProxy::current().get(), | 72         base::MessageLoopProxy::current().get(), | 
| 73         base::MessageLoopProxy::current().get()); | 73         base::MessageLoopProxy::current().get()); | 
| 74     ASSERT_EQ( | 74     ASSERT_EQ( | 
| 75         SYNC_STATUS_OK, | 75         SYNC_STATUS_OK, | 
| 76         file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); | 76         file_system_.MaybeInitializeFileSystemContext(sync_context_.get())); | 
| 77 | 77 | 
| 78     ASSERT_EQ(File::FILE_OK, file_system_.OpenFileSystem()); | 78     ASSERT_EQ(File::FILE_OK, file_system_.OpenFileSystem()); | 
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 400       file_system_.operation_runner()->Truncate( | 400       file_system_.operation_runner()->Truncate( | 
| 401           URL(kFile), 10, | 401           URL(kFile), 10, | 
| 402           ExpectStatus(FROM_HERE, File::FILE_OK)); | 402           ExpectStatus(FROM_HERE, File::FILE_OK)); | 
| 403   file_system_.operation_runner()->Cancel( | 403   file_system_.operation_runner()->Cancel( | 
| 404       id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); | 404       id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); | 
| 405   base::MessageLoop::current()->RunUntilIdle(); | 405   base::MessageLoop::current()->RunUntilIdle(); | 
| 406   EXPECT_EQ(2, callback_count_); | 406   EXPECT_EQ(2, callback_count_); | 
| 407 } | 407 } | 
| 408 | 408 | 
| 409 }  // namespace sync_file_system | 409 }  // namespace sync_file_system | 
| OLD | NEW | 
|---|