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

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: Fix compile error from rebase 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_,
48 NULL) {
44 context_.set_http_transaction_factory(&network_layer_); 49 context_.set_http_transaction_factory(&network_layer_);
45 } 50 }
46 51
47 MockNetworkLayer network_layer_; 52 MockNetworkLayer network_layer_;
48 TestURLRequestContext context_; 53 TestURLRequestContext context_;
49 TestDelegate delegate_; 54 TestDelegate delegate_;
50 TestURLRequest req_; 55 TestURLRequest req_;
51 }; 56 };
52 57
53 // Make sure that SetPriority actually sets the URLRequestHttpJob's 58 // Make sure that SetPriority actually sets the URLRequestHttpJob's
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 116
112 // Creates a second transaction. 117 // Creates a second transaction.
113 job->Start(); 118 job->Start();
114 ASSERT_TRUE(network_layer_.last_transaction()); 119 ASSERT_TRUE(network_layer_.last_transaction());
115 EXPECT_EQ(LOW, network_layer_.last_transaction()->priority()); 120 EXPECT_EQ(LOW, network_layer_.last_transaction()->priority());
116 } 121 }
117 122
118 } // namespace 123 } // namespace
119 124
120 } // namespace net 125 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698