| 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 "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" |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 | 606 |
| 607 void PrinterJobHandlerTest::BeginTest(int timeout_seconds) { | 607 void PrinterJobHandlerTest::BeginTest(int timeout_seconds) { |
| 608 job_handler_ = new PrinterJobHandler(basic_info_, | 608 job_handler_ = new PrinterJobHandler(basic_info_, |
| 609 info_from_cloud_, | 609 info_from_cloud_, |
| 610 GURL(kExampleCloudPrintServerURL), | 610 GURL(kExampleCloudPrintServerURL), |
| 611 print_system_.get(), | 611 print_system_.get(), |
| 612 &jobhandler_delegate_); | 612 &jobhandler_delegate_); |
| 613 | 613 |
| 614 job_handler_->Initialize(); | 614 job_handler_->Initialize(); |
| 615 | 615 |
| 616 base::MessageLoop::current()->PostDelayedTask( | 616 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 617 FROM_HERE, | 617 FROM_HERE, base::Bind(&PrinterJobHandlerTest::MessageLoopQuitSoonHelper, |
| 618 base::Bind(&PrinterJobHandlerTest::MessageLoopQuitSoonHelper, | 618 base::MessageLoop::current()), |
| 619 base::MessageLoop::current()), | |
| 620 base::TimeDelta::FromSeconds(timeout_seconds)); | 619 base::TimeDelta::FromSeconds(timeout_seconds)); |
| 621 | 620 |
| 622 base::MessageLoop::current()->Run(); | 621 base::MessageLoop::current()->Run(); |
| 623 } | 622 } |
| 624 | 623 |
| 625 void PrinterJobHandlerTest::SendCapsAndDefaults( | 624 void PrinterJobHandlerTest::SendCapsAndDefaults( |
| 626 const std::string& printer_name, | 625 const std::string& printer_name, |
| 627 const PrintSystem::PrinterCapsAndDefaultsCallback& callback) { | 626 const PrintSystem::PrinterCapsAndDefaultsCallback& callback) { |
| 628 callback.Run(true, printer_name, caps_and_defaults_); | 627 callback.Run(true, printer_name, caps_and_defaults_); |
| 629 } | 628 } |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 .WillOnce(InvokeWithoutArgs( | 819 .WillOnce(InvokeWithoutArgs( |
| 821 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs)); | 820 this, &PrinterJobHandlerTest::MakeJobFetchReturnNoJobs)); |
| 822 | 821 |
| 823 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) | 822 EXPECT_CALL(url_callback_, OnRequestCreate(TicketURI(1), _)) |
| 824 .Times(AtLeast(kNumRetriesBeforeAbandonJob)); | 823 .Times(AtLeast(kNumRetriesBeforeAbandonJob)); |
| 825 | 824 |
| 826 BeginTest(70); | 825 BeginTest(70); |
| 827 } | 826 } |
| 828 | 827 |
| 829 } // namespace cloud_print | 828 } // namespace cloud_print |
| OLD | NEW |