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

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

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/files/file.h" 8 #include "base/files/file.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 write_bytes_ += bytes; 125 write_bytes_ += bytes;
126 write_complete_ = complete; 126 write_complete_ = complete;
127 ++callback_count_; 127 ++callback_count_;
128 } 128 }
129 129
130 void DidFinish(const tracked_objects::Location& location, 130 void DidFinish(const tracked_objects::Location& location,
131 File::Error expect, File::Error status) { 131 File::Error expect, File::Error status) {
132 SCOPED_TRACE(testing::Message() << location.ToString()); 132 SCOPED_TRACE(testing::Message() << location.ToString());
133 EXPECT_EQ(expect, status); 133 EXPECT_EQ(expect, status);
134 ++callback_count_; 134 ++callback_count_;
135 base::MessageLoop::current()->Quit(); 135 base::MessageLoop::current()->QuitWhenIdle();
136 } 136 }
137 137
138 bool CreateTempFile(base::FilePath* path) { 138 bool CreateTempFile(base::FilePath* path) {
139 return base::CreateTemporaryFileInDir(dir_.path(), path); 139 return base::CreateTemporaryFileInDir(dir_.path(), path);
140 } 140 }
141 141
142 content::TestBrowserThreadBundle thread_bundle_; 142 content::TestBrowserThreadBundle thread_bundle_;
143 143
144 base::ScopedTempDir dir_; 144 base::ScopedTempDir dir_;
145 scoped_ptr<leveldb::Env> in_memory_env_; 145 scoped_ptr<leveldb::Env> in_memory_env_;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 storage::FileSystemOperationRunner::OperationID id = 402 storage::FileSystemOperationRunner::OperationID id =
403 file_system_.operation_runner()->Truncate( 403 file_system_.operation_runner()->Truncate(
404 URL(kFile), 10, ExpectStatus(FROM_HERE, File::FILE_OK)); 404 URL(kFile), 10, ExpectStatus(FROM_HERE, File::FILE_OK));
405 file_system_.operation_runner()->Cancel( 405 file_system_.operation_runner()->Cancel(
406 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); 406 id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION));
407 base::RunLoop().Run(); 407 base::RunLoop().Run();
408 EXPECT_EQ(2, callback_count_); 408 EXPECT_EQ(2, callback_count_);
409 } 409 }
410 410
411 } // namespace sync_file_system 411 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698