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

Side by Side Diff: components/printing/test/print_web_view_helper_browsertest.cc

Issue 2962983002: Print Preview: change getPreview to cr.sendWithPromise (Closed)
Patch Set: Fix PrintWebViewHelperBrowsertest Created 3 years, 5 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
OLDNEW
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 "components/printing/renderer/print_web_view_helper.h" 5 #include "components/printing/renderer/print_web_view_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <tuple> 10 #include <tuple>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) 123 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
124 class DidPreviewPageListener : public IPC::Listener { 124 class DidPreviewPageListener : public IPC::Listener {
125 public: 125 public:
126 explicit DidPreviewPageListener(base::RunLoop* run_loop) 126 explicit DidPreviewPageListener(base::RunLoop* run_loop)
127 : run_loop_(run_loop) {} 127 : run_loop_(run_loop) {}
128 128
129 bool OnMessageReceived(const IPC::Message& message) override { 129 bool OnMessageReceived(const IPC::Message& message) override {
130 if (message.type() == PrintHostMsg_MetafileReadyForPrinting::ID || 130 if (message.type() == PrintHostMsg_MetafileReadyForPrinting::ID ||
131 message.type() == PrintHostMsg_PrintPreviewFailed::ID || 131 message.type() == PrintHostMsg_PrintPreviewFailed::ID ||
132 message.type() == PrintHostMsg_PrintPreviewCancelled::ID) 132 message.type() == PrintHostMsg_PrintPreviewCancelled::ID ||
133 message.type() == PrintHostMsg_PrintPreviewInvalidPrinterSettings::ID)
133 run_loop_->Quit(); 134 run_loop_->Quit();
134 return false; 135 return false;
135 } 136 }
136 137
137 private: 138 private:
138 base::RunLoop* const run_loop_; 139 base::RunLoop* const run_loop_;
139 DISALLOW_COPY_AND_ASSIGN(DidPreviewPageListener); 140 DISALLOW_COPY_AND_ASSIGN(DidPreviewPageListener);
140 }; 141 };
141 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) 142 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
142 143
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 1157
1157 VerifyPrintFailed(true); 1158 VerifyPrintFailed(true);
1158 VerifyPagesPrinted(false); 1159 VerifyPagesPrinted(false);
1159 } 1160 }
1160 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) 1161 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
1161 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) 1162 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
1162 1163
1163 #endif // !defined(OS_CHROMEOS) 1164 #endif // !defined(OS_CHROMEOS)
1164 1165
1165 } // namespace printing 1166 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698