Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/printing/print_job_unittest.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/string16.h" 6 #include "base/string16.h"
7 #include "chrome/browser/printing/print_job.h" 7 #include "chrome/browser/printing/print_job.h"
8 #include "chrome/browser/printing/print_job_worker.h" 8 #include "chrome/browser/printing/print_job_worker.h"
9 #include "chrome/common/chrome_notification_types.h" 9 #include "chrome/common/chrome_notification_types.h"
10 #include "content/public/browser/notification_registrar.h" 10 #include "content/public/browser/notification_registrar.h"
11 #include "content/common/notification_service.h" 11 #include "content/public/browser/notification_service.h"
12 #include "printing/printed_pages_source.h" 12 #include "printing/printed_pages_source.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace { 15 namespace {
16 16
17 class TestSource : public printing::PrintedPagesSource { 17 class TestSource : public printing::PrintedPagesSource {
18 public: 18 public:
19 virtual string16 RenderSourceName() OVERRIDE { 19 virtual string16 RenderSourceName() OVERRIDE {
20 return string16(); 20 return string16();
21 } 21 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 TEST_F(PrintJobTest, MAYBE_SimplePrint) { 94 TEST_F(PrintJobTest, MAYBE_SimplePrint) {
95 // Test the multi-threaded nature of PrintJob to make sure we can use it with 95 // Test the multi-threaded nature of PrintJob to make sure we can use it with
96 // known lifetime. 96 // known lifetime.
97 97
98 // This message loop is actually never run. 98 // This message loop is actually never run.
99 MessageLoop current; 99 MessageLoop current;
100 100
101 content::NotificationRegistrar registrar_; 101 content::NotificationRegistrar registrar_;
102 TestPrintNotifObserv observ; 102 TestPrintNotifObserv observ;
103 registrar_.Add(&observ, content::NOTIFICATION_ALL, 103 registrar_.Add(&observ, content::NOTIFICATION_ALL,
104 NotificationService::AllSources()); 104 content::NotificationService::AllSources());
105 volatile bool check = false; 105 volatile bool check = false;
106 scoped_refptr<printing::PrintJob> job(new TestPrintJob(&check)); 106 scoped_refptr<printing::PrintJob> job(new TestPrintJob(&check));
107 EXPECT_EQ(MessageLoop::current(), job->message_loop()); 107 EXPECT_EQ(MessageLoop::current(), job->message_loop());
108 scoped_refptr<TestOwner> owner(new TestOwner); 108 scoped_refptr<TestOwner> owner(new TestOwner);
109 TestSource source; 109 TestSource source;
110 job->Initialize(owner, &source, 1); 110 job->Initialize(owner, &source, 1);
111 job->Stop(); 111 job->Stop();
112 job = NULL; 112 job = NULL;
113 EXPECT_TRUE(check); 113 EXPECT_TRUE(check);
114 } 114 }
(...skipping 22 matching lines...) Expand all
137 job->is_job_pending(); 137 job->is_job_pending();
138 job->document(); 138 job->document();
139 // Private 139 // Private
140 job->UpdatePrintedDocument(NULL); 140 job->UpdatePrintedDocument(NULL);
141 scoped_refptr<printing::JobEventDetails> event_details; 141 scoped_refptr<printing::JobEventDetails> event_details;
142 job->OnNotifyPrintJobEvent(event_details); 142 job->OnNotifyPrintJobEvent(event_details);
143 job->OnDocumentDone(); 143 job->OnDocumentDone();
144 job->ControlledWorkerShutdown(); 144 job->ControlledWorkerShutdown();
145 */ 145 */
146 } 146 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job_manager.cc ('k') | chrome/browser/printing/print_job_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698