OLD | NEW |
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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/md5.h" | 6 #include "base/md5.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 } // namespace | 245 } // namespace |
246 | 246 |
247 class CloudPrintURLFetcherNoServiceProcess | 247 class CloudPrintURLFetcherNoServiceProcess |
248 : public CloudPrintURLFetcher { | 248 : public CloudPrintURLFetcher { |
249 public: | 249 public: |
250 CloudPrintURLFetcherNoServiceProcess() : | 250 CloudPrintURLFetcherNoServiceProcess() : |
251 context_getter_(new net::TestURLRequestContextGetter( | 251 context_getter_(new net::TestURLRequestContextGetter( |
252 base::MessageLoopProxy::current())) {} | 252 base::MessageLoopProxy::current())) {} |
253 protected: | 253 protected: |
254 virtual net::URLRequestContextGetter* GetRequestContextGetter() override { | 254 net::URLRequestContextGetter* GetRequestContextGetter() override { |
255 return context_getter_.get(); | 255 return context_getter_.get(); |
256 } | 256 } |
257 | 257 |
258 virtual ~CloudPrintURLFetcherNoServiceProcess() {} | 258 ~CloudPrintURLFetcherNoServiceProcess() override {} |
| 259 |
259 private: | 260 private: |
260 scoped_refptr<net::URLRequestContextGetter> context_getter_; | 261 scoped_refptr<net::URLRequestContextGetter> context_getter_; |
261 }; | 262 }; |
262 | 263 |
263 | 264 |
264 class CloudPrintURLFetcherNoServiceProcessFactory | 265 class CloudPrintURLFetcherNoServiceProcessFactory |
265 : public CloudPrintURLFetcherFactory { | 266 : public CloudPrintURLFetcherFactory { |
266 public: | 267 public: |
267 virtual CloudPrintURLFetcher* CreateCloudPrintURLFetcher() override { | 268 CloudPrintURLFetcher* CreateCloudPrintURLFetcher() override { |
268 return new CloudPrintURLFetcherNoServiceProcess; | 269 return new CloudPrintURLFetcherNoServiceProcess; |
269 } | 270 } |
270 | 271 |
271 virtual ~CloudPrintURLFetcherNoServiceProcessFactory() {} | 272 ~CloudPrintURLFetcherNoServiceProcessFactory() override {} |
272 }; | 273 }; |
273 | 274 |
274 | 275 |
275 // This class handles the callback from FakeURLFetcher | 276 // This class handles the callback from FakeURLFetcher |
276 // It is a separate class because callback methods must be | 277 // It is a separate class because callback methods must be |
277 // on RefCounted classes | 278 // on RefCounted classes |
278 | 279 |
279 class TestURLFetcherCallback { | 280 class TestURLFetcherCallback { |
280 public: | 281 public: |
281 scoped_ptr<net::FakeURLFetcher> CreateURLFetcher( | 282 scoped_ptr<net::FakeURLFetcher> CreateURLFetcher( |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 .WillOnce(InvokeWithoutArgs( | 818 .WillOnce(InvokeWithoutArgs( |
818 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs)); | 819 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs)); |
819 | 820 |
820 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) | 821 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) |
821 .Times(AtLeast(kNumRetriesBeforeAbandonJob)); | 822 .Times(AtLeast(kNumRetriesBeforeAbandonJob)); |
822 | 823 |
823 BeginTest(70); | 824 BeginTest(70); |
824 } | 825 } |
825 | 826 |
826 } // namespace cloud_print | 827 } // namespace cloud_print |
OLD | NEW |