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

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

Issue 8801006: Make the transfer request code path use full referrers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "content/browser/browser_thread_impl.h" 7 #include "content/browser/browser_thread_impl.h"
8 #include "content/browser/mock_resource_context.h" 8 #include "content/browser/mock_resource_context.h"
9 #include "content/browser/renderer_host/dummy_resource_handler.h" 9 #include "content/browser/renderer_host/dummy_resource_handler.h"
10 #include "content/browser/renderer_host/global_request_id.h" 10 #include "content/browser/renderer_host/global_request_id.h"
11 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" 11 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
12 #include "content/browser/renderer_host/resource_queue.h" 12 #include "content/browser/renderer_host/resource_queue.h"
13 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
14 #include "net/url_request/url_request.h" 14 #include "net/url_request/url_request.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 using content::BrowserThread; 17 using content::BrowserThread;
18 using content::BrowserThreadImpl; 18 using content::BrowserThreadImpl;
19 using content::DummyResourceHandler; 19 using content::DummyResourceHandler;
20 20
21 namespace { 21 namespace {
22 22
23 const char kTestUrl[] = "data:text/plain,Hello World!"; 23 const char kTestUrl[] = "data:text/plain,Hello World!";
24 24
25 ResourceDispatcherHostRequestInfo* GetRequestInfo(int request_id) { 25 ResourceDispatcherHostRequestInfo* GetRequestInfo(int request_id) {
26 return new ResourceDispatcherHostRequestInfo( 26 return new ResourceDispatcherHostRequestInfo(
27 new DummyResourceHandler(), content::PROCESS_TYPE_RENDERER, 0, 0, 0, 27 new DummyResourceHandler(), content::PROCESS_TYPE_RENDERER, 0, 0, 0,
28 request_id, false, -1, false, -1, ResourceType::MAIN_FRAME, 28 request_id, false, -1, false, -1, ResourceType::MAIN_FRAME,
29 content::PAGE_TRANSITION_LINK, 0, false, false, false, 29 content::PAGE_TRANSITION_LINK, 0, false, false, false,
30 WebKit::WebReferrerPolicyDefault,
30 content::MockResourceContext::GetInstance()); 31 content::MockResourceContext::GetInstance());
31 } 32 }
32 33
33 void InitializeQueue(ResourceQueue* queue, ResourceQueueDelegate* delegate) { 34 void InitializeQueue(ResourceQueue* queue, ResourceQueueDelegate* delegate) {
34 ResourceQueue::DelegateSet delegate_set; 35 ResourceQueue::DelegateSet delegate_set;
35 delegate_set.insert(delegate); 36 delegate_set.insert(delegate);
36 queue->Initialize(delegate_set); 37 queue->Initialize(delegate_set);
37 } 38 }
38 39
39 void InitializeQueue(ResourceQueue* queue, 40 void InitializeQueue(ResourceQueue* queue,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 MessageLoop::current()->RunAllPending(); 257 MessageLoop::current()->RunAllPending();
257 EXPECT_EQ(0, response_started_count_); 258 EXPECT_EQ(0, response_started_count_);
258 259
259 queue.Shutdown(); 260 queue.Shutdown();
260 261
261 MessageLoop::current()->RunAllPending(); 262 MessageLoop::current()->RunAllPending();
262 EXPECT_EQ(0, response_started_count_); 263 EXPECT_EQ(0, response_started_count_);
263 } 264 }
264 265
265 } // namespace 266 } // namespace
OLDNEW
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_unittest.cc ('k') | content/common/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698