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

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

Issue 1068793002: Fixed "blocking io" from FixupPath on UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed adding cwd aka "blocking IO" used in FixupURL via FilePathToFileURL, also fixed client code Created 5 years, 8 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 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 public: 300 public:
301 PrintPreviewPdfGeneratedBrowserTest() {} 301 PrintPreviewPdfGeneratedBrowserTest() {}
302 ~PrintPreviewPdfGeneratedBrowserTest() override {} 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(base::MakeAbsoluteFilePath(path));
311 311
312 ui_test_utils::NavigateToURL(browser(), gurl); 312 ui_test_utils::NavigateToURL(browser(), gurl);
313 313
314 base::RunLoop loop; 314 base::RunLoop loop;
315 print_preview_observer_->set_quit_closure(loop.QuitClosure()); 315 print_preview_observer_->set_quit_closure(loop.QuitClosure());
316 chrome::Print(browser()); 316 chrome::Print(browser());
317 loop.Run(); 317 loop.Run();
318 318
319 // Need to check whether the save was successful. Ending the loop only 319 // Need to check whether the save was successful. Ending the loop only
320 // means the save was attempted. 320 // means the save was attempted.
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 // waiting for this message and start waiting for the image data. 630 // waiting for this message and start waiting for the image data.
631 std::cout << "#EOF\n"; 631 std::cout << "#EOF\n";
632 std::cout.flush(); 632 std::cout.flush();
633 633
634 SendPng(); 634 SendPng();
635 Reset(); 635 Reset();
636 } 636 }
637 } 637 }
638 638
639 } // namespace printing 639 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chromecast/browser/service/cast_service_simple.cc » ('j') | chromecast/browser/service/cast_service_simple.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698