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

Unified Diff: chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc

Issue 42366: Fix single-process ui test failures from my previous change. The problem was... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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: chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
===================================================================
--- chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc (revision 12019)
+++ chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc (working copy)
@@ -87,7 +87,7 @@
public ResourceDispatcherHost::Receiver {
public:
ResourceDispatcherHostTest()
- : Receiver(ChildProcessInfo::RENDER_PROCESS), host_(NULL) {
+ : Receiver(ChildProcessInfo::RENDER_PROCESS), host_(NULL), pid_(-1) {
set_handle(base::GetCurrentProcessHandle());
}
// ResourceDispatcherHost::Receiver implementation
@@ -103,6 +103,8 @@
return NULL;
}
+ virtual int GetProcessId() const { return pid_; }
+
protected:
// testing::Test
virtual void SetUp() {
@@ -145,6 +147,7 @@
MessageLoopForIO message_loop_;
ResourceDispatcherHost host_;
ResourceIPCAccumulator accum_;
+ int pid_;
};
// Spin up the message loop to kick off the request.
@@ -165,14 +168,13 @@
int render_view_id,
int request_id,
const GURL& url) {
- int old_pid = pid();
pid_ = render_process_id;
ViewHostMsg_Resource_Request request = CreateResourceRequest("GET", url);
ViewHostMsg_RequestResource msg(render_view_id, request_id, request);
bool msg_was_ok;
host_.OnMessageReceived(msg, receiver, &msg_was_ok);
KickOffRequest();
- pid_ = old_pid;
+ pid_ = -1;
}
void ResourceDispatcherHostTest::MakeCancelRequest(int request_id) {
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698