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" | 5 #include "chrome/browser/printing/print_job.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // known lifetime. | 96 // known lifetime. |
97 | 97 |
98 content::TestBrowserThreadBundle thread_bundle_; | 98 content::TestBrowserThreadBundle thread_bundle_; |
99 content::NotificationRegistrar registrar_; | 99 content::NotificationRegistrar registrar_; |
100 TestPrintNotificationObserver observer; | 100 TestPrintNotificationObserver observer; |
101 registrar_.Add(&observer, | 101 registrar_.Add(&observer, |
102 content::NOTIFICATION_ALL, | 102 content::NOTIFICATION_ALL, |
103 content::NotificationService::AllSources()); | 103 content::NotificationService::AllSources()); |
104 volatile bool check = false; | 104 volatile bool check = false; |
105 scoped_refptr<PrintJob> job(new TestPrintJob(&check)); | 105 scoped_refptr<PrintJob> job(new TestPrintJob(&check)); |
106 EXPECT_TRUE(job->RunsTasksOnCurrentThread()); | 106 EXPECT_TRUE(job->RunsTasksInCurrentSequence()); |
107 scoped_refptr<TestOwner> owner(new TestOwner); | 107 scoped_refptr<TestOwner> owner(new TestOwner); |
108 TestSource source; | 108 TestSource source; |
109 job->Initialize(owner.get(), &source, 1); | 109 job->Initialize(owner.get(), &source, 1); |
110 job->Stop(); | 110 job->Stop(); |
111 while (job->document()) { | 111 while (job->document()) { |
112 base::RunLoop().RunUntilIdle(); | 112 base::RunLoop().RunUntilIdle(); |
113 } | 113 } |
114 EXPECT_FALSE(job->document()); | 114 EXPECT_FALSE(job->document()); |
115 job = nullptr; | 115 job = nullptr; |
116 while (!check) { | 116 while (!check) { |
(...skipping 28 matching lines...) Expand all Loading... |
145 // Private | 145 // Private |
146 job->UpdatePrintedDocument(nullptr); | 146 job->UpdatePrintedDocument(nullptr); |
147 scoped_refptr<JobEventDetails> event_details; | 147 scoped_refptr<JobEventDetails> event_details; |
148 job->OnNotifyPrintJobEvent(event_details); | 148 job->OnNotifyPrintJobEvent(event_details); |
149 job->OnDocumentDone(); | 149 job->OnDocumentDone(); |
150 job->ControlledWorkerShutdown(); | 150 job->ControlledWorkerShutdown(); |
151 */ | 151 */ |
152 } | 152 } |
153 | 153 |
154 } // namespace printing | 154 } // namespace printing |
OLD | NEW |