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

Unified Diff: trunk/src/content/browser/fileapi/fileapi_message_filter_unittest.cc

Issue 23551005: Revert 219709 "Remove the Extensions URLRequestContext." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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: trunk/src/content/browser/fileapi/fileapi_message_filter_unittest.cc
===================================================================
--- trunk/src/content/browser/fileapi/fileapi_message_filter_unittest.cc (revision 219785)
+++ trunk/src/content/browser/fileapi/fileapi_message_filter_unittest.cc (working copy)
@@ -9,8 +9,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory.h"
+#include "base/message_loop/message_loop.h"
#include "base/process/process.h"
-#include "base/run_loop.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/streams/stream_registry.h"
@@ -20,7 +20,7 @@
#include "content/public/common/common_param_traits.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
-#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_browser_thread.h"
#include "net/base/io_buffer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/browser/blob/blob_storage_controller.h"
@@ -42,6 +42,11 @@
} // namespace
class FileAPIMessageFilterTest : public testing::Test {
+ public:
+ FileAPIMessageFilterTest()
+ : io_browser_thread_(BrowserThread::IO, &message_loop_) {
+ }
+
protected:
virtual void SetUp() OVERRIDE {
file_system_context_ =
@@ -67,7 +72,7 @@
stream_context_);
// Complete initialization.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
}
// Tests via OnMessageReceived(const IPC::Message&). The channel proxy calls
@@ -79,7 +84,8 @@
return casted_filter->OnMessageReceived(message);
}
- TestBrowserThreadBundle thread_bundle_;
+ base::MessageLoop message_loop_;
+ TestBrowserThread io_browser_thread_;
TestBrowserContext browser_context_;
scoped_refptr<fileapi::FileSystemContext> file_system_context_;
@@ -128,7 +134,7 @@
filter->OnChannelConnected(0);
// Complete initialization.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
IPC::ChannelProxy::MessageFilter* casted_filter =
static_cast<IPC::ChannelProxy::MessageFilter*>(filter.get());
@@ -142,7 +148,7 @@
filter->OnChannelClosing();
// This shouldn't cause DCHECK failure.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
}
TEST_F(FileAPIMessageFilterTest, MultipleFilters) {
@@ -164,7 +170,7 @@
filter2->OnChannelConnected(1);
// Complete initialization.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
IPC::ChannelProxy::MessageFilter* casted_filter =
static_cast<IPC::ChannelProxy::MessageFilter*>(filter1.get());
@@ -178,7 +184,7 @@
filter2->OnChannelClosing();
// This shouldn't cause DCHECK failure.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
}
TEST_F(FileAPIMessageFilterTest, BuildEmptyStream) {
@@ -221,7 +227,7 @@
EXPECT_EQ(0, bytes_read);
// Run loop to finish transfer.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
EXPECT_EQ(Stream::STREAM_COMPLETE,
stream->ReadRawData(buffer.get(), kBufferSize, &bytes_read));
@@ -251,7 +257,7 @@
EXPECT_TRUE(InvokeOnMessageReceived(finish_message));
// Run loop to finish transfer and commit finalize command.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(kFakeData.size()));
int bytes_read = 0;
@@ -299,7 +305,7 @@
EXPECT_TRUE(InvokeOnMessageReceived(finish_message));
// Run loop to finish transfer and commit finalize command.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(kFakeData.size()));
int bytes_read = 0;
« no previous file with comments | « trunk/src/content/browser/browser_context.cc ('k') | trunk/src/content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698