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

Side by Side Diff: net/url_request/url_request_http_job_unittest.cc

Issue 51953002: [Net] Add a priority parameter to URLRequest's constructor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 1 month 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "net/base/auth.h" 11 #include "net/base/auth.h"
12 #include "net/base/request_priority.h"
12 #include "net/http/http_transaction_factory.h" 13 #include "net/http/http_transaction_factory.h"
13 #include "net/http/http_transaction_unittest.h" 14 #include "net/http/http_transaction_unittest.h"
14 #include "net/url_request/url_request_status.h" 15 #include "net/url_request/url_request_status.h"
15 #include "net/url_request/url_request_test_util.h" 16 #include "net/url_request/url_request_test_util.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 namespace net { 20 namespace net {
20 21
21 namespace { 22 namespace {
(...skipping 11 matching lines...) Expand all
33 using URLRequestHttpJob::Kill; 34 using URLRequestHttpJob::Kill;
34 using URLRequestHttpJob::priority; 35 using URLRequestHttpJob::priority;
35 36
36 protected: 37 protected:
37 virtual ~TestURLRequestHttpJob() {} 38 virtual ~TestURLRequestHttpJob() {}
38 }; 39 };
39 40
40 class URLRequestHttpJobTest : public ::testing::Test { 41 class URLRequestHttpJobTest : public ::testing::Test {
41 protected: 42 protected:
42 URLRequestHttpJobTest() 43 URLRequestHttpJobTest()
43 : req_(GURL("http://www.example.com"), &delegate_, &context_, NULL) { 44 : req_(GURL("http://www.example.com"),
45 DEFAULT_PRIORITY,
46 &delegate_,
47 &context_) {
44 context_.set_http_transaction_factory(&network_layer_); 48 context_.set_http_transaction_factory(&network_layer_);
45 } 49 }
46 50
47 MockNetworkLayer network_layer_; 51 MockNetworkLayer network_layer_;
48 TestURLRequestContext context_; 52 TestURLRequestContext context_;
49 TestDelegate delegate_; 53 TestDelegate delegate_;
50 TestURLRequest req_; 54 TestURLRequest req_;
51 }; 55 };
52 56
53 // Make sure that SetPriority actually sets the URLRequestHttpJob's 57 // Make sure that SetPriority actually sets the URLRequestHttpJob's
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 115
112 // Creates a second transaction. 116 // Creates a second transaction.
113 job->Start(); 117 job->Start();
114 ASSERT_TRUE(network_layer_.last_transaction()); 118 ASSERT_TRUE(network_layer_.last_transaction());
115 EXPECT_EQ(LOW, network_layer_.last_transaction()->priority()); 119 EXPECT_EQ(LOW, network_layer_.last_transaction()->priority());
116 } 120 }
117 121
118 } // namespace 122 } // namespace
119 123
120 } // namespace net 124 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_ftp_job_unittest.cc ('k') | net/url_request/url_request_job_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698