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

Side by Side Diff: webkit/fileapi/file_system_file_stream_reader_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/file_system_file_stream_reader.h" 5 #include "webkit/fileapi/file_system_file_stream_reader.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 new FileSystemContext( 73 new FileSystemContext(
74 FileSystemTaskRunners::CreateMockTaskRunners(), 74 FileSystemTaskRunners::CreateMockTaskRunners(),
75 special_storage_policy_, 75 special_storage_policy_,
76 NULL, 76 NULL,
77 temp_dir_.path(), 77 temp_dir_.path(),
78 CreateDisallowFileAccessOptions()); 78 CreateDisallowFileAccessOptions());
79 79
80 file_system_context_->sandbox_provider()->ValidateFileSystemRoot( 80 file_system_context_->sandbox_provider()->ValidateFileSystemRoot(
81 GURL(kURLOrigin), kFileSystemTypeTemporary, true, // create 81 GURL(kURLOrigin), kFileSystemTypeTemporary, true, // create
82 base::Bind(&OnValidateFileSystem)); 82 base::Bind(&OnValidateFileSystem));
83 MessageLoop::current()->RunAllPending(); 83 MessageLoop::current()->RunUntilIdle();
84 84
85 WriteFile(kTestFileName, kTestData, kTestDataSize, 85 WriteFile(kTestFileName, kTestData, kTestDataSize,
86 &test_file_modification_time_); 86 &test_file_modification_time_);
87 } 87 }
88 88
89 virtual void TearDown() OVERRIDE { 89 virtual void TearDown() OVERRIDE {
90 MessageLoop::current()->RunAllPending(); 90 MessageLoop::current()->RunUntilIdle();
91 } 91 }
92 92
93 protected: 93 protected:
94 FileSystemFileStreamReader* CreateFileReader( 94 FileSystemFileStreamReader* CreateFileReader(
95 const std::string& file_name, 95 const std::string& file_name,
96 int64 initial_offset, 96 int64 initial_offset,
97 const base::Time& expected_modification_time) { 97 const base::Time& expected_modification_time) {
98 return new FileSystemFileStreamReader(file_system_context_, 98 return new FileSystemFileStreamReader(file_system_context_,
99 GetFileSystemURL(file_name), 99 GetFileSystemURL(file_name),
100 initial_offset, 100 initial_offset,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 new net::IOBufferWithSize(kTestDataSize)); 279 new net::IOBufferWithSize(kTestDataSize));
280 int rv = reader->Read(buf, buf->size(), base::Bind(&NeverCalled)); 280 int rv = reader->Read(buf, buf->size(), base::Bind(&NeverCalled));
281 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); 281 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0);
282 282
283 // Delete immediately. 283 // Delete immediately.
284 // Should not crash; nor should NeverCalled be callback. 284 // Should not crash; nor should NeverCalled be callback.
285 reader.reset(); 285 reader.reset();
286 } 286 }
287 287
288 } // namespace fileapi 288 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_dir_url_request_job_unittest.cc ('k') | webkit/fileapi/file_system_quota_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698