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

Unified Diff: net/base/upload_file_element_reader_unittest.cc

Issue 23872030: Fix teardown in tests which use UploadFileElementReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert SetUp to constructors Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/upload_data_stream_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_file_element_reader_unittest.cc
diff --git a/net/base/upload_file_element_reader_unittest.cc b/net/base/upload_file_element_reader_unittest.cc
index 8224f773046beee8317096143cdea81c0feb446e..b0435019e9ce7d22dd6ffb091e4fbdb7cb8f1640 100644
--- a/net/base/upload_file_element_reader_unittest.cc
+++ b/net/base/upload_file_element_reader_unittest.cc
@@ -7,6 +7,7 @@
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/run_loop.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
@@ -17,7 +18,8 @@ namespace net {
class UploadFileElementReaderTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() {
+ PlatformTest::SetUp();
// Some tests (*.ReadPartially) rely on bytes_.size() being even.
const char kData[] = "123456789abcdefghi";
bytes_.assign(kData, kData + arraysize(kData) - 1);
@@ -44,6 +46,11 @@ class UploadFileElementReaderTest : public PlatformTest {
EXPECT_FALSE(reader_->IsInMemory());
}
+ virtual ~UploadFileElementReaderTest() {
+ reader_.reset();
+ base::RunLoop().RunUntilIdle();
+ }
+
std::vector<char> bytes_;
scoped_ptr<UploadElementReader> reader_;
base::ScopedTempDir temp_dir_;
« no previous file with comments | « net/base/upload_data_stream_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698