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

Side by Side Diff: content/browser/fileapi/local_file_stream_reader_unittest.cc

Issue 1398153002: Don't use base::MessageLoop::{Quit,QuitClosure} in content/ (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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "storage/browser/fileapi/local_file_stream_reader.h" 5 #include "storage/browser/fileapi/local_file_stream_reader.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 break; 49 break;
50 total_bytes_read += rv; 50 total_bytes_read += rv;
51 data->append(buf->data(), rv); 51 data->append(buf->data(), rv);
52 } 52 }
53 } 53 }
54 54
55 void NeverCalled(int) { ADD_FAILURE(); } 55 void NeverCalled(int) { ADD_FAILURE(); }
56 void EmptyCallback() {} 56 void EmptyCallback() {}
57 57
58 void QuitLoop() { 58 void QuitLoop() {
59 base::MessageLoop::current()->Quit(); 59 base::MessageLoop::current()->QuitWhenIdle();
60 } 60 }
61 61
62 } // namespace 62 } // namespace
63 63
64 class LocalFileStreamReaderTest : public testing::Test { 64 class LocalFileStreamReaderTest : public testing::Test {
65 public: 65 public:
66 LocalFileStreamReaderTest() 66 LocalFileStreamReaderTest()
67 : file_thread_("FileUtilProxyTestFileThread") {} 67 : file_thread_("FileUtilProxyTestFileThread") {}
68 68
69 void SetUp() override { 69 void SetUp() override {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled)); 268 int rv = reader->Read(buf.get(), buf->size(), base::Bind(&NeverCalled));
269 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0); 269 ASSERT_TRUE(rv == net::ERR_IO_PENDING || rv >= 0);
270 270
271 // Delete immediately. 271 // Delete immediately.
272 // Should not crash; nor should NeverCalled be callback. 272 // Should not crash; nor should NeverCalled be callback.
273 reader.reset(); 273 reader.reset();
274 EnsureFileTaskFinished(); 274 EnsureFileTaskFinished();
275 } 275 }
276 276
277 } // namespace content 277 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/fileapi/file_writer_delegate_unittest.cc ('k') | content/browser/fileapi/mock_url_request_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698