| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/printing/print_job.h" |
| 6 |
| 5 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 6 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 7 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/printing/print_job.h" | |
| 9 #include "chrome/browser/printing/print_job_worker.h" | 10 #include "chrome/browser/printing/print_job_worker.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
| 11 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
| 13 #include "content/public/common/child_process_host.h" |
| 12 #include "printing/printed_pages_source.h" | 14 #include "printing/printed_pages_source.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 16 |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| 17 class TestSource : public printing::PrintedPagesSource { | 19 class TestSource : public printing::PrintedPagesSource { |
| 18 public: | 20 public: |
| 19 virtual base::string16 RenderSourceName() OVERRIDE { | 21 virtual base::string16 RenderSourceName() OVERRIDE { |
| 20 return base::string16(); | 22 return base::string16(); |
| 21 } | 23 } |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 class TestPrintJobWorker : public printing::PrintJobWorker { | 26 class TestPrintJobWorker : public printing::PrintJobWorker { |
| 25 public: | 27 public: |
| 26 explicit TestPrintJobWorker(printing::PrintJobWorkerOwner* owner) | 28 explicit TestPrintJobWorker(printing::PrintJobWorkerOwner* owner) |
| 27 : printing::PrintJobWorker(owner) { | 29 : printing::PrintJobWorker(content::ChildProcessHost::kInvalidUniqueID, |
| 28 } | 30 content::ChildProcessHost::kInvalidUniqueID, |
| 31 owner) {} |
| 29 friend class TestOwner; | 32 friend class TestOwner; |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 class TestOwner : public printing::PrintJobWorkerOwner { | 35 class TestOwner : public printing::PrintJobWorkerOwner { |
| 33 public: | 36 public: |
| 34 virtual void GetSettingsDone( | 37 virtual void GetSettingsDone( |
| 35 const printing::PrintSettings& new_settings, | 38 const printing::PrintSettings& new_settings, |
| 36 printing::PrintingContext::Result result) OVERRIDE { | 39 printing::PrintingContext::Result result) OVERRIDE { |
| 37 EXPECT_FALSE(true); | 40 EXPECT_FALSE(true); |
| 38 } | 41 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 job->is_job_pending(); | 140 job->is_job_pending(); |
| 138 job->document(); | 141 job->document(); |
| 139 // Private | 142 // Private |
| 140 job->UpdatePrintedDocument(NULL); | 143 job->UpdatePrintedDocument(NULL); |
| 141 scoped_refptr<printing::JobEventDetails> event_details; | 144 scoped_refptr<printing::JobEventDetails> event_details; |
| 142 job->OnNotifyPrintJobEvent(event_details); | 145 job->OnNotifyPrintJobEvent(event_details); |
| 143 job->OnDocumentDone(); | 146 job->OnDocumentDone(); |
| 144 job->ControlledWorkerShutdown(); | 147 job->ControlledWorkerShutdown(); |
| 145 */ | 148 */ |
| 146 } | 149 } |
| OLD | NEW |