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

Side by Side Diff: chrome/service/cloud_print/printer_job_handler_unittest.cc

Issue 2888763004: Network traffic annotation added to CloudPrintUrlFetcher. (Closed)
Patch Set: nits Created 3 years, 6 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 | « chrome/service/cloud_print/printer_job_handler.cc ('k') | 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) 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 "chrome/service/cloud_print/printer_job_handler.h" 5 #include "chrome/service/cloud_print/printer_job_handler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/md5.h" 11 #include "base/md5.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/threading/thread_task_runner_handle.h" 17 #include "base/threading/thread_task_runner_handle.h"
18 #include "chrome/common/cloud_print/cloud_print_constants.h" 18 #include "chrome/common/cloud_print/cloud_print_constants.h"
19 #include "chrome/service/cloud_print/cloud_print_service_helpers.h" 19 #include "chrome/service/cloud_print/cloud_print_service_helpers.h"
20 #include "chrome/service/cloud_print/cloud_print_token_store.h" 20 #include "chrome/service/cloud_print/cloud_print_token_store.h"
21 #include "chrome/service/cloud_print/print_system.h" 21 #include "chrome/service/cloud_print/print_system.h"
22 #include "net/http/http_response_headers.h" 22 #include "net/http/http_response_headers.h"
23 #include "net/http/http_status_code.h" 23 #include "net/http/http_status_code.h"
24 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
24 #include "net/url_request/test_url_fetcher_factory.h" 25 #include "net/url_request/test_url_fetcher_factory.h"
25 #include "net/url_request/url_request_status.h" 26 #include "net/url_request/url_request_status.h"
26 #include "net/url_request/url_request_test_util.h" 27 #include "net/url_request/url_request_test_util.h"
27 #include "printing/backend/print_backend.h" 28 #include "printing/backend/print_backend.h"
28 #include "testing/gmock/include/gmock/gmock.h" 29 #include "testing/gmock/include/gmock/gmock.h"
29 #include "testing/gtest/include/gtest/gtest.h" 30 #include "testing/gtest/include/gtest/gtest.h"
30 31
31 using ::testing::AtLeast; 32 using ::testing::AtLeast;
32 using ::testing::DoAll; 33 using ::testing::DoAll;
33 using ::testing::Exactly; 34 using ::testing::Exactly;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 job_num, 247 job_num,
247 status_string); 248 status_string);
248 } 249 }
249 250
250 } // namespace 251 } // namespace
251 252
252 class CloudPrintURLFetcherNoServiceProcess 253 class CloudPrintURLFetcherNoServiceProcess
253 : public CloudPrintURLFetcher { 254 : public CloudPrintURLFetcher {
254 public: 255 public:
255 CloudPrintURLFetcherNoServiceProcess() 256 CloudPrintURLFetcherNoServiceProcess()
256 : context_getter_(new net::TestURLRequestContextGetter( 257 : CloudPrintURLFetcher(PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS),
258 context_getter_(new net::TestURLRequestContextGetter(
257 base::ThreadTaskRunnerHandle::Get())) {} 259 base::ThreadTaskRunnerHandle::Get())) {}
258 260
259 protected: 261 protected:
260 net::URLRequestContextGetter* GetRequestContextGetter() override { 262 net::URLRequestContextGetter* GetRequestContextGetter() override {
261 return context_getter_.get(); 263 return context_getter_.get();
262 } 264 }
263 265
264 ~CloudPrintURLFetcherNoServiceProcess() override {} 266 ~CloudPrintURLFetcherNoServiceProcess() override {}
265 267
266 private: 268 private:
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 .WillOnce(InvokeWithoutArgs( 822 .WillOnce(InvokeWithoutArgs(
821 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs)); 823 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs));
822 824
823 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) 825 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _))
824 .Times(AtLeast(kNumRetriesBeforeAbandonJob)); 826 .Times(AtLeast(kNumRetriesBeforeAbandonJob));
825 827
826 BeginTest(70); 828 BeginTest(70);
827 } 829 }
828 830
829 } // namespace cloud_print 831 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/printer_job_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698