OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <algorithm> | 5 #include <algorithm> |
6 #include <fstream> | 6 #include <fstream> |
7 #include <iostream> | 7 #include <iostream> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 State state_; | 292 State state_; |
293 std::string failed_setting_; | 293 std::string failed_setting_; |
294 const base::FilePath pdf_file_save_path_; | 294 const base::FilePath pdf_file_save_path_; |
295 | 295 |
296 DISALLOW_COPY_AND_ASSIGN(PrintPreviewObserver); | 296 DISALLOW_COPY_AND_ASSIGN(PrintPreviewObserver); |
297 }; | 297 }; |
298 | 298 |
299 class PrintPreviewPdfGeneratedBrowserTest : public InProcessBrowserTest { | 299 class PrintPreviewPdfGeneratedBrowserTest : public InProcessBrowserTest { |
300 public: | 300 public: |
301 PrintPreviewPdfGeneratedBrowserTest() {} | 301 PrintPreviewPdfGeneratedBrowserTest() {} |
302 virtual ~PrintPreviewPdfGeneratedBrowserTest() {} | 302 ~PrintPreviewPdfGeneratedBrowserTest() override {} |
303 | 303 |
304 // Navigates to the given web page, then initiates print preview and waits | 304 // Navigates to the given web page, then initiates print preview and waits |
305 // for all the settings to be set, then save the preview to PDF. | 305 // for all the settings to be set, then save the preview to PDF. |
306 void NavigateAndPrint(const base::FilePath::StringType& file_name, | 306 void NavigateAndPrint(const base::FilePath::StringType& file_name, |
307 const PrintPreviewSettings& settings) { | 307 const PrintPreviewSettings& settings) { |
308 print_preview_observer_->SetPrintPreviewSettings(settings); | 308 print_preview_observer_->SetPrintPreviewSettings(settings); |
309 base::FilePath path(file_name); | 309 base::FilePath path(file_name); |
310 GURL gurl = net::FilePathToFileURL(path); | 310 GURL gurl = net::FilePathToFileURL(path); |
311 | 311 |
312 ui_test_utils::NavigateToURL(browser(), gurl); | 312 ui_test_utils::NavigateToURL(browser(), gurl); |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 // waiting for this message and start waiting for the image data. | 693 // waiting for this message and start waiting for the image data. |
694 std::cout << "#EOF\n"; | 694 std::cout << "#EOF\n"; |
695 std::cout.flush(); | 695 std::cout.flush(); |
696 | 696 |
697 SendPng(); | 697 SendPng(); |
698 Reset(); | 698 Reset(); |
699 } | 699 } |
700 } | 700 } |
701 | 701 |
702 } // namespace printing | 702 } // namespace printing |
OLD | NEW |