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

Side by Side Diff: storage/browser/fileapi/file_system_operation_impl_write_unittest.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() Created 3 years, 7 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
« no previous file with comments | « services/ui/service.cc ('k') | third_party/WebKit/Source/core/frame/PerformanceMonitor.h » ('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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void DidWrite(base::File::Error status, int64_t bytes, bool complete) { 132 void DidWrite(base::File::Error status, int64_t bytes, bool complete) {
133 if (status == base::File::FILE_OK) { 133 if (status == base::File::FILE_OK) {
134 add_bytes_written(bytes, complete); 134 add_bytes_written(bytes, complete);
135 if (complete) 135 if (complete)
136 base::MessageLoop::current()->QuitWhenIdle(); 136 base::MessageLoop::current()->QuitWhenIdle();
137 } else { 137 } else {
138 EXPECT_FALSE(complete_); 138 EXPECT_FALSE(complete_);
139 EXPECT_EQ(status_, base::File::FILE_OK); 139 EXPECT_EQ(status_, base::File::FILE_OK);
140 complete_ = true; 140 complete_ = true;
141 status_ = status; 141 status_ = status;
142 if (base::MessageLoop::current()->is_running()) 142 if (base::RunLoop::IsRunningOnCurrentThread())
143 base::MessageLoop::current()->QuitWhenIdle(); 143 base::MessageLoop::current()->QuitWhenIdle();
144 } 144 }
145 } 145 }
146 146
147 void DidCancel(base::File::Error status) { cancel_status_ = status; } 147 void DidCancel(base::File::Error status) { cancel_status_ = status; }
148 148
149 const MockBlobURLRequestContext& url_request_context() const { 149 const MockBlobURLRequestContext& url_request_context() const {
150 return *url_request_context_; 150 return *url_request_context_;
151 } 151 }
152 152
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 EXPECT_EQ(base::File::FILE_ERROR_ABORT, status()); 315 EXPECT_EQ(base::File::FILE_ERROR_ABORT, status());
316 EXPECT_EQ(base::File::FILE_OK, cancel_status()); 316 EXPECT_EQ(base::File::FILE_OK, cancel_status());
317 EXPECT_TRUE(complete()); 317 EXPECT_TRUE(complete());
318 318
319 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); 319 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count());
320 } 320 }
321 321
322 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. 322 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases.
323 323
324 } // namespace content 324 } // namespace content
OLDNEW
« no previous file with comments | « services/ui/service.cc ('k') | third_party/WebKit/Source/core/frame/PerformanceMonitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698