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