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

Side by Side Diff: webkit/fileapi/syncable/local_file_sync_context_unittest.cc

Issue 11595003: webkit: Update the calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 "webkit/fileapi/syncable/local_file_sync_context.h" 5 #include "webkit/fileapi/syncable/local_file_sync_context.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); 161 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread());
162 file_error_ = base::PLATFORM_FILE_ERROR_FAILED; 162 file_error_ = base::PLATFORM_FILE_ERROR_FAILED;
163 file_system->NewOperation()->Truncate( 163 file_system->NewOperation()->Truncate(
164 url, 1, base::Bind(&LocalFileSyncContextTest::DidModifyFile, 164 url, 1, base::Bind(&LocalFileSyncContextTest::DidModifyFile,
165 base::Unretained(this))); 165 base::Unretained(this)));
166 } 166 }
167 167
168 base::PlatformFileError WaitUntilModifyFileIsDone() { 168 base::PlatformFileError WaitUntilModifyFileIsDone() {
169 while (!async_modify_finished_) 169 while (!async_modify_finished_)
170 MessageLoop::current()->RunAllPending(); 170 MessageLoop::current()->RunUntilIdle();
171 return file_error_; 171 return file_error_;
172 } 172 }
173 173
174 void DidModifyFile(base::PlatformFileError error) { 174 void DidModifyFile(base::PlatformFileError error) {
175 if (!ui_task_runner_->RunsTasksOnCurrentThread()) { 175 if (!ui_task_runner_->RunsTasksOnCurrentThread()) {
176 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); 176 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread());
177 ui_task_runner_->PostTask( 177 ui_task_runner_->PostTask(
178 FROM_HERE, 178 FROM_HERE,
179 base::Bind(&LocalFileSyncContextTest::DidModifyFile, 179 base::Bind(&LocalFileSyncContextTest::DidModifyFile,
180 base::Unretained(this), error)); 180 base::Unretained(this), error));
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // Make sure all three files/directory exist. 594 // Make sure all three files/directory exist.
595 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile1)); 595 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile1));
596 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile2)); 596 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kFile2));
597 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.DirectoryExists(kDir)); 597 EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.DirectoryExists(kDir));
598 598
599 sync_context_->ShutdownOnUIThread(); 599 sync_context_->ShutdownOnUIThread();
600 file_system.TearDown(); 600 file_system.TearDown();
601 } 601 }
602 602
603 } // namespace fileapi 603 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698