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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "components/printing/common/print_messages.h" | 7 #include "components/printing/common/print_messages.h" |
8 #include "components/printing/renderer/print_web_view_helper.h" | 8 #include "components/printing/renderer/print_web_view_helper.h" |
9 #include "components/printing/test/mock_printer.h" | 9 #include "components/printing/test/mock_printer.h" |
10 #include "components/printing/test/print_mock_render_thread.h" | 10 #include "components/printing/test/print_mock_render_thread.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(dict); | 241 PrintWebViewHelper::Get(view_)->OnPrintForPrintPreview(dict); |
242 ProcessPendingMessages(); | 242 ProcessPendingMessages(); |
243 } | 243 } |
244 | 244 |
245 // Naked pointer as ownership is with content::RenderViewTest::render_thread_. | 245 // Naked pointer as ownership is with content::RenderViewTest::render_thread_. |
246 PrintMockRenderThread* print_render_thread_; | 246 PrintMockRenderThread* print_render_thread_; |
247 | 247 |
248 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperTestBase); | 248 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelperTestBase); |
249 }; | 249 }; |
250 | 250 |
251 // RenderVIewTest-based tests crash on Android | 251 // RenderViewTest-based tests crash on Android |
252 // http://crbug.com/187500 | 252 // http://crbug.com/187500 |
253 #if defined(OS_ANDROID) | 253 #if defined(OS_ANDROID) |
254 #define MAYBE_PrintWebViewHelperTest DISABLED_PrintWebViewHelperTest | 254 #define MAYBE_PrintWebViewHelperTest DISABLED_PrintWebViewHelperTest |
255 #else | 255 #else |
256 #define MAYBE_PrintWebViewHelperTest PrintWebViewHelperTest | 256 #define MAYBE_PrintWebViewHelperTest PrintWebViewHelperTest |
257 #endif // defined(OS_ANDROID) | 257 #endif // defined(OS_ANDROID) |
258 | 258 |
259 class MAYBE_PrintWebViewHelperTest : public PrintWebViewHelperTestBase { | 259 class MAYBE_PrintWebViewHelperTest : public PrintWebViewHelperTestBase { |
260 public: | 260 public: |
261 MAYBE_PrintWebViewHelperTest() {} | 261 MAYBE_PrintWebViewHelperTest() {} |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 base::CreateTemporaryFile(&bitmap_path); | 498 base::CreateTemporaryFile(&bitmap_path); |
499 print_render_thread_->printer()->SaveBitmap(0, bitmap_path); | 499 print_render_thread_->printer()->SaveBitmap(0, bitmap_path); |
500 } | 500 } |
501 } | 501 } |
502 } | 502 } |
503 #endif // OS_MACOSX && ENABLE_BASIC_PRINTING | 503 #endif // OS_MACOSX && ENABLE_BASIC_PRINTING |
504 | 504 |
505 // These print preview tests do not work on Chrome OS yet. | 505 // These print preview tests do not work on Chrome OS yet. |
506 #if !defined(OS_CHROMEOS) | 506 #if !defined(OS_CHROMEOS) |
507 | 507 |
508 // RenderVIewTest-based tests crash on Android | 508 // RenderViewTest-based tests crash on Android |
509 // http://crbug.com/187500 | 509 // http://crbug.com/187500 |
510 #if defined(OS_ANDROID) | 510 #if defined(OS_ANDROID) |
511 #define MAYBE_PrintWebViewHelperPreviewTest \ | 511 #define MAYBE_PrintWebViewHelperPreviewTest \ |
512 DISABLED_PrintWebViewHelperPreviewTest | 512 DISABLED_PrintWebViewHelperPreviewTest |
513 #else | 513 #else |
514 #define MAYBE_PrintWebViewHelperPreviewTest PrintWebViewHelperPreviewTest | 514 #define MAYBE_PrintWebViewHelperPreviewTest PrintWebViewHelperPreviewTest |
515 #endif // defined(OS_ANDROID) | 515 #endif // defined(OS_ANDROID) |
516 | 516 |
517 class MAYBE_PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase { | 517 class MAYBE_PrintWebViewHelperPreviewTest : public PrintWebViewHelperTestBase { |
518 public: | 518 public: |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 CreatePrintSettingsDictionary(&dict); | 1042 CreatePrintSettingsDictionary(&dict); |
1043 OnPrintForPrintPreview(dict); | 1043 OnPrintForPrintPreview(dict); |
1044 | 1044 |
1045 VerifyPrintFailed(true); | 1045 VerifyPrintFailed(true); |
1046 VerifyPagesPrinted(false); | 1046 VerifyPagesPrinted(false); |
1047 } | 1047 } |
1048 | 1048 |
1049 #endif // !defined(OS_CHROMEOS) | 1049 #endif // !defined(OS_CHROMEOS) |
1050 | 1050 |
1051 } // namespace printing | 1051 } // namespace printing |
OLD | NEW |