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

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

Issue 42360: Fix a UMR error in chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc (Closed)
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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <vector> 5 #include <vector>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/process_util.h" 8 #include "base/process_util.h"
9 #include "chrome/browser/renderer_host/renderer_security_policy.h" 9 #include "chrome/browser/renderer_host/renderer_security_policy.h"
10 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 10 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
(...skipping 23 matching lines...) Expand all
34 ViewHostMsg_Resource_Request request; 34 ViewHostMsg_Resource_Request request;
35 request.method = std::string(method); 35 request.method = std::string(method);
36 request.url = url; 36 request.url = url;
37 request.policy_url = url; // bypass third-party cookie blocking 37 request.policy_url = url; // bypass third-party cookie blocking
38 // init the rest to default values to prevent getting UMR. 38 // init the rest to default values to prevent getting UMR.
39 request.frame_origin = "null"; 39 request.frame_origin = "null";
40 request.main_frame_origin = "null"; 40 request.main_frame_origin = "null";
41 request.load_flags = 0; 41 request.load_flags = 0;
42 request.origin_pid = 0; 42 request.origin_pid = 0;
43 request.resource_type = ResourceType::SUB_RESOURCE; 43 request.resource_type = ResourceType::SUB_RESOURCE;
44 request.request_context = 0;
44 return request; 45 return request;
45 } 46 }
46 47
47 // We may want to move this to a shared space if it is useful for something else 48 // We may want to move this to a shared space if it is useful for something else
48 class ResourceIPCAccumulator { 49 class ResourceIPCAccumulator {
49 public: 50 public:
50 void AddMessage(const IPC::Message& msg) { 51 void AddMessage(const IPC::Message& msg) {
51 messages_.push_back(msg); 52 messages_.push_back(msg);
52 } 53 }
53 54
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 EXPECT_EQ(URLRequestStatus::CANCELED, status.status()); 640 EXPECT_EQ(URLRequestStatus::CANCELED, status.status());
640 EXPECT_EQ(net::ERR_INSUFFICIENT_RESOURCES, status.os_error()); 641 EXPECT_EQ(net::ERR_INSUFFICIENT_RESOURCES, status.os_error());
641 } 642 }
642 643
643 // The final 2 requests should have succeeded. 644 // The final 2 requests should have succeeded.
644 CheckSuccessfulRequest(msgs[kMaxRequests + 2], 645 CheckSuccessfulRequest(msgs[kMaxRequests + 2],
645 URLRequestTestJob::test_data_2()); 646 URLRequestTestJob::test_data_2());
646 CheckSuccessfulRequest(msgs[kMaxRequests + 3], 647 CheckSuccessfulRequest(msgs[kMaxRequests + 3],
647 URLRequestTestJob::test_data_2()); 648 URLRequestTestJob::test_data_2());
648 } 649 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698