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

Side by Side Diff: content/browser/renderer_host/resource_dispatcher_host_unittest.cc

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialize to NULL Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/resource_dispatcher_host_impl.h" 5 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 URLRequestTestDelayedStartJob::ClearQueue(); 370 URLRequestTestDelayedStartJob::ClearQueue();
371 371
372 DCHECK(test_fixture_ == this); 372 DCHECK(test_fixture_ == this);
373 test_fixture_ = NULL; 373 test_fixture_ = NULL;
374 374
375 host_.Shutdown(); 375 host_.Shutdown();
376 376
377 ChildProcessSecurityPolicyImpl::GetInstance()->Remove(0); 377 ChildProcessSecurityPolicyImpl::GetInstance()->Remove(0);
378 378
379 // Flush the message loop to make application verifiers happy. 379 // Flush the message loop to make application verifiers happy.
380 if (ResourceDispatcherHostImpl::Get())
381 ResourceDispatcherHostImpl::Get()->CancelRequestsForContext(
382 browser_context_->GetResourceContext());
380 browser_context_.reset(); 383 browser_context_.reset();
381 message_loop_.RunAllPending(); 384 message_loop_.RunAllPending();
382 } 385 }
383 386
384 // Creates a request using the current test object as the filter. 387 // Creates a request using the current test object as the filter.
385 void MakeTestRequest(int render_view_id, 388 void MakeTestRequest(int render_view_id,
386 int request_id, 389 int request_id,
387 const GURL& url); 390 const GURL& url);
388 391
389 // Generates a request using the given filter. This will probably be a 392 // Generates a request using the given filter. This will probably be a
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 PickleIterator iter(msgs[0][0]); 1399 PickleIterator iter(msgs[0][0]);
1397 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &request_id)); 1400 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &request_id));
1398 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &status)); 1401 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &status));
1399 1402
1400 EXPECT_EQ(1, request_id); 1403 EXPECT_EQ(1, request_id);
1401 EXPECT_EQ(net::URLRequestStatus::FAILED, status.status()); 1404 EXPECT_EQ(net::URLRequestStatus::FAILED, status.status());
1402 EXPECT_EQ(net::ERR_UNKNOWN_URL_SCHEME, status.error()); 1405 EXPECT_EQ(net::ERR_UNKNOWN_URL_SCHEME, status.error());
1403 } 1406 }
1404 1407
1405 } // namespace content 1408 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_process_sub_thread.cc ('k') | content/common/net/url_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698