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

Side by Side Diff: webkit/fileapi/local_file_system_operation_write_unittest.cc

Issue 11103027: Support filesystem files from BlobURLRequestJob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 2 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 (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 #include <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 class LocalFileSystemOperationWriteTest 73 class LocalFileSystemOperationWriteTest
74 : public testing::Test, 74 : public testing::Test,
75 public base::SupportsWeakPtr<LocalFileSystemOperationWriteTest> { 75 public base::SupportsWeakPtr<LocalFileSystemOperationWriteTest> {
76 public: 76 public:
77 LocalFileSystemOperationWriteTest() 77 LocalFileSystemOperationWriteTest()
78 : test_helper_(GURL("http://example.com"), kFileSystemTypeTest), 78 : test_helper_(GURL("http://example.com"), kFileSystemTypeTest),
79 loop_(MessageLoop::TYPE_IO), 79 loop_(MessageLoop::TYPE_IO),
80 status_(base::PLATFORM_FILE_OK), 80 status_(base::PLATFORM_FILE_OK),
81 cancel_status_(base::PLATFORM_FILE_ERROR_FAILED), 81 cancel_status_(base::PLATFORM_FILE_ERROR_FAILED),
82 bytes_written_(0), 82 bytes_written_(0),
83 complete_(false) { 83 complete_(false),
84 url_request_context_(test_helper_.file_system_context()) {
84 change_observers_ = MockFileChangeObserver::CreateList(&change_observer_); 85 change_observers_ = MockFileChangeObserver::CreateList(&change_observer_);
85 } 86 }
86 87
87 LocalFileSystemOperation* operation(); 88 LocalFileSystemOperation* operation();
88 89
89 base::PlatformFileError status() const { return status_; } 90 base::PlatformFileError status() const { return status_; }
90 base::PlatformFileError cancel_status() const { return cancel_status_; } 91 base::PlatformFileError cancel_status() const { return cancel_status_; }
91 void add_bytes_written(int64 bytes, bool complete) { 92 void add_bytes_written(int64 bytes, bool complete) {
92 bytes_written_ += bytes; 93 bytes_written_ += bytes;
93 EXPECT_FALSE(complete_); 94 EXPECT_FALSE(complete_);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); 345 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status());
345 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); 346 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status());
346 EXPECT_TRUE(complete()); 347 EXPECT_TRUE(complete());
347 348
348 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); 349 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count());
349 } 350 }
350 351
351 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. 352 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases.
352 353
353 } // namespace fileapi 354 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/blob/mock_blob_url_request_context.cc ('k') | webkit/fileapi/syncable/local_file_change_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698