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" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "chrome/common/cloud_print/cloud_print_constants.h" | 12 #include "chrome/common/cloud_print/cloud_print_constants.h" |
13 #include "chrome/service/cloud_print/cloud_print_service_helpers.h" | 13 #include "chrome/service/cloud_print/cloud_print_service_helpers.h" |
14 #include "chrome/service/cloud_print/cloud_print_token_store.h" | 14 #include "chrome/service/cloud_print/cloud_print_token_store.h" |
15 #include "chrome/service/cloud_print/print_system.h" | 15 #include "chrome/service/cloud_print/print_system.h" |
16 #include "chrome/service/cloud_print/printer_job_handler.h" | 16 #include "chrome/service/cloud_print/printer_job_handler.h" |
17 #include "net/http/http_response_headers.h" | 17 #include "net/http/http_response_headers.h" |
18 #include "net/http/http_status_code.h" | 18 #include "net/http/http_status_code.h" |
19 #include "net/url_request/test_url_fetcher_factory.h" | 19 #include "net/url_request/test_url_fetcher_factory.h" |
| 20 #include "net/url_request/url_request_status.h" |
20 #include "net/url_request/url_request_test_util.h" | 21 #include "net/url_request/url_request_test_util.h" |
21 #include "printing/backend/print_backend.h" | 22 #include "printing/backend/print_backend.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 | 25 |
25 using ::testing::AtLeast; | 26 using ::testing::AtLeast; |
26 using ::testing::DoAll; | 27 using ::testing::DoAll; |
27 using ::testing::Exactly; | 28 using ::testing::Exactly; |
28 using ::testing::Invoke; | 29 using ::testing::Invoke; |
29 using ::testing::InvokeWithoutArgs; | 30 using ::testing::InvokeWithoutArgs; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( |
282 const GURL& url, | 283 const GURL& url, |
283 net::URLFetcherDelegate* d, | 284 net::URLFetcherDelegate* d, |
284 const std::string& response_data, | 285 const std::string& response_data, |
285 net::HttpStatusCode response_code) { | 286 net::URLRequestStatus request_status) { |
286 scoped_ptr<net::FakeURLFetcher> fetcher( | 287 scoped_ptr<net::FakeURLFetcher> fetcher( |
287 new net::FakeURLFetcher(url, d, response_data, response_code)); | 288 new net::FakeURLFetcher(url, d, response_data, request_status)); |
288 OnRequestCreate(url, fetcher.get()); | 289 OnRequestCreate(url, fetcher.get()); |
289 return fetcher.Pass(); | 290 return fetcher.Pass(); |
290 } | 291 } |
291 MOCK_METHOD2(OnRequestCreate, | 292 MOCK_METHOD2(OnRequestCreate, |
292 void(const GURL&, net::FakeURLFetcher*)); | 293 void(const GURL&, net::FakeURLFetcher*)); |
293 }; | 294 }; |
294 | 295 |
295 | 296 |
296 class MockPrinterJobHandlerDelegate | 297 class MockPrinterJobHandlerDelegate |
297 : public PrinterJobHandler::Delegate { | 298 : public PrinterJobHandler::Delegate { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 .WillByDefault(Invoke(this, &PrinterJobHandlerTest::GetPrinterInfo)); | 492 .WillByDefault(Invoke(this, &PrinterJobHandlerTest::GetPrinterInfo)); |
492 | 493 |
493 ON_CALL(*print_system_.get(), GetPrinterCapsAndDefaults(_, _)) | 494 ON_CALL(*print_system_.get(), GetPrinterCapsAndDefaults(_, _)) |
494 .WillByDefault(Invoke(this, &PrinterJobHandlerTest::SendCapsAndDefaults)); | 495 .WillByDefault(Invoke(this, &PrinterJobHandlerTest::SendCapsAndDefaults)); |
495 | 496 |
496 CloudPrintURLFetcher::set_factory(&cloud_print_factory_); | 497 CloudPrintURLFetcher::set_factory(&cloud_print_factory_); |
497 } | 498 } |
498 | 499 |
499 void PrinterJobHandlerTest::MakeJobFetchReturnNoJobs() { | 500 void PrinterJobHandlerTest::MakeJobFetchReturnNoJobs() { |
500 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), | 501 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), |
501 JobListResponse(0), net::HTTP_OK); | 502 JobListResponse(0), net::HTTP_OK, |
| 503 net::URLRequestStatus::SUCCESS); |
502 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), | 504 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), |
503 JobListResponse(0), net::HTTP_OK); | 505 JobListResponse(0), net::HTTP_OK, |
| 506 net::URLRequestStatus::SUCCESS); |
504 factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry), | 507 factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry), |
505 JobListResponse(0), net::HTTP_OK); | 508 JobListResponse(0), net::HTTP_OK, |
| 509 net::URLRequestStatus::SUCCESS); |
506 } | 510 } |
507 | 511 |
508 void PrinterJobHandlerTest::MessageLoopQuitNowHelper( | 512 void PrinterJobHandlerTest::MessageLoopQuitNowHelper( |
509 base::MessageLoop* message_loop) { | 513 base::MessageLoop* message_loop) { |
510 message_loop->QuitWhenIdle(); | 514 message_loop->QuitWhenIdle(); |
511 } | 515 } |
512 | 516 |
513 void PrinterJobHandlerTest::MessageLoopQuitSoonHelper( | 517 void PrinterJobHandlerTest::MessageLoopQuitSoonHelper( |
514 base::MessageLoop* message_loop) { | 518 base::MessageLoop* message_loop) { |
515 message_loop->message_loop_proxy()->PostTask( | 519 message_loop->message_loop_proxy()->PostTask( |
(...skipping 21 matching lines...) Expand all Loading... |
537 void PrinterJobHandlerTest::AddMimeHeader(const GURL& url, | 541 void PrinterJobHandlerTest::AddMimeHeader(const GURL& url, |
538 net::FakeURLFetcher* fetcher) { | 542 net::FakeURLFetcher* fetcher) { |
539 scoped_refptr<net::HttpResponseHeaders> download_headers = | 543 scoped_refptr<net::HttpResponseHeaders> download_headers = |
540 new net::HttpResponseHeaders(kExampleJobDownloadResponseHeaders); | 544 new net::HttpResponseHeaders(kExampleJobDownloadResponseHeaders); |
541 fetcher->set_response_headers(download_headers); | 545 fetcher->set_response_headers(download_headers); |
542 } | 546 } |
543 | 547 |
544 | 548 |
545 void PrinterJobHandlerTest::SetUpJobSuccessTest(int job_num) { | 549 void PrinterJobHandlerTest::SetUpJobSuccessTest(int job_num) { |
546 factory_.SetFakeResponse(TicketURI(job_num), | 550 factory_.SetFakeResponse(TicketURI(job_num), |
547 kExamplePrintTicket, net::HTTP_OK); | 551 kExamplePrintTicket, net::HTTP_OK, |
| 552 net::URLRequestStatus::SUCCESS); |
548 factory_.SetFakeResponse(DownloadURI(job_num), | 553 factory_.SetFakeResponse(DownloadURI(job_num), |
549 kExamplePrintData, net::HTTP_OK); | 554 kExamplePrintData, net::HTTP_OK, |
| 555 net::URLRequestStatus::SUCCESS); |
550 | 556 |
551 factory_.SetFakeResponse(DoneURI(job_num), | 557 factory_.SetFakeResponse(DoneURI(job_num), |
552 StatusResponse(job_num, "DONE"), | 558 StatusResponse(job_num, "DONE"), |
553 net::HTTP_OK); | 559 net::HTTP_OK, |
| 560 net::URLRequestStatus::SUCCESS); |
554 factory_.SetFakeResponse(InProgressURI(job_num), | 561 factory_.SetFakeResponse(InProgressURI(job_num), |
555 StatusResponse(job_num, "IN_PROGRESS"), | 562 StatusResponse(job_num, "IN_PROGRESS"), |
556 net::HTTP_OK); | 563 net::HTTP_OK, |
| 564 net::URLRequestStatus::SUCCESS); |
557 | 565 |
558 // The times requirement is relaxed for the ticket URI | 566 // The times requirement is relaxed for the ticket URI |
559 // in order to accommodate TicketDownloadFailureTest | 567 // in order to accommodate TicketDownloadFailureTest |
560 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(job_num), _)) | 568 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(job_num), _)) |
561 .Times(AtLeast(1)); | 569 .Times(AtLeast(1)); |
562 | 570 |
563 EXPECT_CALL(url_callback_, OnRequestCreate(DownloadURI(job_num), _)) | 571 EXPECT_CALL(url_callback_, OnRequestCreate(DownloadURI(job_num), _)) |
564 .Times(Exactly(1)) | 572 .Times(Exactly(1)) |
565 .WillOnce(Invoke(this, &PrinterJobHandlerTest::AddMimeHeader)); | 573 .WillOnce(Invoke(this, &PrinterJobHandlerTest::AddMimeHeader)); |
566 | 574 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 658 |
651 ON_CALL(*this, ValidatePrintTicket(_, _)). | 659 ON_CALL(*this, ValidatePrintTicket(_, _)). |
652 WillByDefault(Return(true)); | 660 WillByDefault(Return(true)); |
653 }; | 661 }; |
654 | 662 |
655 // This test simulates an end-to-end printing of a document | 663 // This test simulates an end-to-end printing of a document |
656 // but tests only non-failure cases. | 664 // but tests only non-failure cases. |
657 // Disabled - http://crbug.com/184245 | 665 // Disabled - http://crbug.com/184245 |
658 TEST_F(PrinterJobHandlerTest, DISABLED_HappyPathTest) { | 666 TEST_F(PrinterJobHandlerTest, DISABLED_HappyPathTest) { |
659 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), | 667 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), |
660 JobListResponse(1), net::HTTP_OK); | 668 JobListResponse(1), net::HTTP_OK, |
| 669 net::URLRequestStatus::SUCCESS); |
661 factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore), | 670 factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore), |
662 JobListResponse(0), net::HTTP_OK); | 671 JobListResponse(0), net::HTTP_OK, |
| 672 net::URLRequestStatus::SUCCESS); |
663 | 673 |
664 EXPECT_CALL(url_callback_, | 674 EXPECT_CALL(url_callback_, |
665 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) | 675 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) |
666 .Times(Exactly(1)); | 676 .Times(Exactly(1)); |
667 EXPECT_CALL(url_callback_, | 677 EXPECT_CALL(url_callback_, |
668 OnRequestCreate(JobListURI(kJobFetchReasonQueryMore), _)) | 678 OnRequestCreate(JobListURI(kJobFetchReasonQueryMore), _)) |
669 .Times(Exactly(1)); | 679 .Times(Exactly(1)); |
670 | 680 |
671 SetUpJobSuccessTest(1); | 681 SetUpJobSuccessTest(1); |
672 BeginTest(20); | 682 BeginTest(20); |
673 } | 683 } |
674 | 684 |
675 TEST_F(PrinterJobHandlerTest, TicketDownloadFailureTest) { | 685 TEST_F(PrinterJobHandlerTest, TicketDownloadFailureTest) { |
676 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), | 686 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), |
677 JobListResponse(2), net::HTTP_OK); | 687 JobListResponse(2), net::HTTP_OK, |
| 688 net::URLRequestStatus::SUCCESS); |
678 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), | 689 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), |
679 JobListResponse(2), net::HTTP_OK); | 690 JobListResponse(2), net::HTTP_OK, |
| 691 net::URLRequestStatus::SUCCESS); |
680 factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore), | 692 factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore), |
681 JobListResponse(0), net::HTTP_OK); | 693 JobListResponse(0), net::HTTP_OK, |
| 694 net::URLRequestStatus::SUCCESS); |
682 factory_.SetFakeResponse(TicketURI(1), std::string(), | 695 factory_.SetFakeResponse(TicketURI(1), std::string(), |
683 net::HTTP_INTERNAL_SERVER_ERROR); | 696 net::HTTP_INTERNAL_SERVER_ERROR, |
| 697 net::URLRequestStatus::FAILED); |
684 | 698 |
685 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) | 699 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) |
686 .Times(AtLeast(1)); | 700 .Times(AtLeast(1)); |
687 | 701 |
688 EXPECT_CALL(url_callback_, | 702 EXPECT_CALL(url_callback_, |
689 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) | 703 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) |
690 .Times(AtLeast(1)); | 704 .Times(AtLeast(1)); |
691 | 705 |
692 EXPECT_CALL(url_callback_, | 706 EXPECT_CALL(url_callback_, |
693 OnRequestCreate(JobListURI(kJobFetchReasonQueryMore), _)) | 707 OnRequestCreate(JobListURI(kJobFetchReasonQueryMore), _)) |
694 .Times(AtLeast(1)); | 708 .Times(AtLeast(1)); |
695 | 709 |
696 EXPECT_CALL(url_callback_, | 710 EXPECT_CALL(url_callback_, |
697 OnRequestCreate(JobListURI(kJobFetchReasonFailure), _)) | 711 OnRequestCreate(JobListURI(kJobFetchReasonFailure), _)) |
698 .Times(AtLeast(1)); | 712 .Times(AtLeast(1)); |
699 | 713 |
700 SetUpJobSuccessTest(2); | 714 SetUpJobSuccessTest(2); |
701 BeginTest(20); | 715 BeginTest(20); |
702 } | 716 } |
703 | 717 |
704 // TODO(noamsml): Figure out how to make this test not take 1 second and | 718 // TODO(noamsml): Figure out how to make this test not take 1 second and |
705 // re-enable it | 719 // re-enable it |
706 TEST_F(PrinterJobHandlerTest, DISABLED_ManyFailureTest) { | 720 TEST_F(PrinterJobHandlerTest, DISABLED_ManyFailureTest) { |
707 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), | 721 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), |
708 JobListResponse(1), net::HTTP_OK); | 722 JobListResponse(1), net::HTTP_OK, |
| 723 net::URLRequestStatus::SUCCESS); |
709 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), | 724 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), |
710 JobListResponse(1), net::HTTP_OK); | 725 JobListResponse(1), net::HTTP_OK, |
| 726 net::URLRequestStatus::SUCCESS); |
711 factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry), | 727 factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry), |
712 JobListResponse(1), net::HTTP_OK); | 728 JobListResponse(1), net::HTTP_OK, |
| 729 net::URLRequestStatus::SUCCESS); |
713 factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore), | 730 factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore), |
714 JobListResponse(0), net::HTTP_OK); | 731 JobListResponse(0), net::HTTP_OK, |
| 732 net::URLRequestStatus::SUCCESS); |
715 | 733 |
716 EXPECT_CALL(url_callback_, | 734 EXPECT_CALL(url_callback_, |
717 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) | 735 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) |
718 .Times(AtLeast(1)); | 736 .Times(AtLeast(1)); |
719 | 737 |
720 EXPECT_CALL(url_callback_, | 738 EXPECT_CALL(url_callback_, |
721 OnRequestCreate(JobListURI(kJobFetchReasonQueryMore), _)) | 739 OnRequestCreate(JobListURI(kJobFetchReasonQueryMore), _)) |
722 .Times(AtLeast(1)); | 740 .Times(AtLeast(1)); |
723 | 741 |
724 EXPECT_CALL(url_callback_, | 742 EXPECT_CALL(url_callback_, |
725 OnRequestCreate(JobListURI(kJobFetchReasonFailure), _)) | 743 OnRequestCreate(JobListURI(kJobFetchReasonFailure), _)) |
726 .Times(AtLeast(1)); | 744 .Times(AtLeast(1)); |
727 | 745 |
728 EXPECT_CALL(url_callback_, | 746 EXPECT_CALL(url_callback_, |
729 OnRequestCreate(JobListURI(kJobFetchReasonRetry), _)) | 747 OnRequestCreate(JobListURI(kJobFetchReasonRetry), _)) |
730 .Times(AtLeast(1)); | 748 .Times(AtLeast(1)); |
731 | 749 |
732 SetUpJobSuccessTest(1); | 750 SetUpJobSuccessTest(1); |
733 | 751 |
734 factory_.SetFakeResponse(TicketURI(1), | 752 factory_.SetFakeResponse(TicketURI(1), |
735 std::string(), | 753 std::string(), |
736 net::HTTP_INTERNAL_SERVER_ERROR); | 754 net::HTTP_INTERNAL_SERVER_ERROR, |
| 755 net::URLRequestStatus::FAILED); |
737 | 756 |
738 loop_.PostDelayedTask(FROM_HERE, | 757 loop_.PostDelayedTask(FROM_HERE, |
739 base::Bind(&net::FakeURLFetcherFactory::SetFakeResponse, | 758 base::Bind(&net::FakeURLFetcherFactory::SetFakeResponse, |
740 base::Unretained(&factory_), | 759 base::Unretained(&factory_), |
741 TicketURI(1), | 760 TicketURI(1), |
742 kExamplePrintTicket, | 761 kExamplePrintTicket, |
743 net::HTTP_OK), | 762 net::HTTP_OK, |
| 763 net::URLRequestStatus::SUCCESS), |
744 base::TimeDelta::FromSeconds(1)); | 764 base::TimeDelta::FromSeconds(1)); |
745 | 765 |
746 | 766 |
747 BeginTest(5); | 767 BeginTest(5); |
748 } | 768 } |
749 | 769 |
750 | 770 |
751 // TODO(noamsml): Figure out how to make this test not take ~64-~2048 (depending | 771 // TODO(noamsml): Figure out how to make this test not take ~64-~2048 (depending |
752 // constant values) seconds and re-enable it | 772 // constant values) seconds and re-enable it |
753 TEST_F(PrinterJobHandlerTest, DISABLED_CompleteFailureTest) { | 773 TEST_F(PrinterJobHandlerTest, DISABLED_CompleteFailureTest) { |
754 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), | 774 factory_.SetFakeResponse(JobListURI(kJobFetchReasonStartup), |
755 JobListResponse(1), net::HTTP_OK); | 775 JobListResponse(1), net::HTTP_OK, |
| 776 net::URLRequestStatus::SUCCESS); |
756 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), | 777 factory_.SetFakeResponse(JobListURI(kJobFetchReasonFailure), |
757 JobListResponse(1), net::HTTP_OK); | 778 JobListResponse(1), net::HTTP_OK, |
| 779 net::URLRequestStatus::SUCCESS); |
758 factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry), | 780 factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry), |
759 JobListResponse(1), net::HTTP_OK); | 781 JobListResponse(1), net::HTTP_OK, |
| 782 net::URLRequestStatus::SUCCESS); |
760 factory_.SetFakeResponse(ErrorURI(1), StatusResponse(1, "ERROR"), | 783 factory_.SetFakeResponse(ErrorURI(1), StatusResponse(1, "ERROR"), |
761 net::HTTP_OK); | 784 net::HTTP_OK, net::URLRequestStatus::SUCCESS); |
762 factory_.SetFakeResponse(TicketURI(1), std::string(), | 785 factory_.SetFakeResponse(TicketURI(1), std::string(), |
763 net::HTTP_INTERNAL_SERVER_ERROR); | 786 net::HTTP_INTERNAL_SERVER_ERROR, |
| 787 net::URLRequestStatus::FAILED); |
764 | 788 |
765 EXPECT_CALL(url_callback_, | 789 EXPECT_CALL(url_callback_, |
766 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) | 790 OnRequestCreate(JobListURI(kJobFetchReasonStartup), _)) |
767 .Times(AtLeast(1)); | 791 .Times(AtLeast(1)); |
768 | 792 |
769 EXPECT_CALL(url_callback_, | 793 EXPECT_CALL(url_callback_, |
770 OnRequestCreate(JobListURI(kJobFetchReasonFailure), _)) | 794 OnRequestCreate(JobListURI(kJobFetchReasonFailure), _)) |
771 .Times(AtLeast(1)); | 795 .Times(AtLeast(1)); |
772 | 796 |
773 EXPECT_CALL(url_callback_, | 797 EXPECT_CALL(url_callback_, |
774 OnRequestCreate(JobListURI(kJobFetchReasonRetry), _)) | 798 OnRequestCreate(JobListURI(kJobFetchReasonRetry), _)) |
775 .Times(AtLeast(1)); | 799 .Times(AtLeast(1)); |
776 | 800 |
777 EXPECT_CALL(url_callback_, OnRequestCreate(ErrorURI(1), _)) | 801 EXPECT_CALL(url_callback_, OnRequestCreate(ErrorURI(1), _)) |
778 .Times(Exactly(1)) | 802 .Times(Exactly(1)) |
779 .WillOnce(InvokeWithoutArgs( | 803 .WillOnce(InvokeWithoutArgs( |
780 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs)); | 804 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs)); |
781 | 805 |
782 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) | 806 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) |
783 .Times(AtLeast(kNumRetriesBeforeAbandonJob)); | 807 .Times(AtLeast(kNumRetriesBeforeAbandonJob)); |
784 | 808 |
785 BeginTest(70); | 809 BeginTest(70); |
786 } | 810 } |
787 | 811 |
788 } // namespace cloud_print | 812 } // namespace cloud_print |
OLD | NEW |