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

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: 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
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..9ad4deca81a3bd4082909a50e4bc0ddcc29e60fe 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"
@@ -18,6 +19,8 @@ namespace net {
class UploadFileElementReaderTest : public PlatformTest {
protected:
virtual void SetUp() OVERRIDE {
+ PlatformTest::SetUp();
+
// Some tests (*.ReadPartially) rely on bytes_.size() being even.
const char kData[] = "123456789abcdefghi";
bytes_.assign(kData, kData + arraysize(kData) - 1);
@@ -44,6 +47,12 @@ class UploadFileElementReaderTest : public PlatformTest {
EXPECT_FALSE(reader_->IsInMemory());
}
+ virtual void TearDown() OVERRIDE {
+ reader_.reset();
+ base::RunLoop().RunUntilIdle();
+ PlatformTest::TearDown();
+ }
Ryan Sleevi 2013/09/13 18:47:10 Ditto here - it should be possible to update these
+
std::vector<char> bytes_;
scoped_ptr<UploadElementReader> reader_;
base::ScopedTempDir temp_dir_;
« net/base/upload_data_stream_unittest.cc ('K') | « 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