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

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

Issue 2317123002: c/browser, c/common, components O-P: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <fstream> 8 #include <fstream>
9 #include <iostream> 9 #include <iostream>
10 #include <iterator> 10 #include <iterator>
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 _setmode(_fileno(stderr), _O_BINARY); 498 _setmode(_fileno(stderr), _O_BINARY);
499 #endif 499 #endif
500 // Sends a message to the layout test framework indicating indicating 500 // Sends a message to the layout test framework indicating indicating
501 // that the browser test has completed setting itself up. The layout 501 // that the browser test has completed setting itself up. The layout
502 // test will then expect the file path for stdin. 502 // test will then expect the file path for stdin.
503 base::FilePath stdin_path; 503 base::FilePath stdin_path;
504 std::cout << "#READY\n"; 504 std::cout << "#READY\n";
505 std::cout.flush(); 505 std::cout.flush();
506 506
507 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); 507 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir());
508 ASSERT_TRUE(base::CreateTemporaryFileInDir(tmp_dir_.path(), &stdin_path)); 508 ASSERT_TRUE(
509 base::CreateTemporaryFileInDir(tmp_dir_.GetPath(), &stdin_path));
509 510
510 // Redirects |std::cin| to the file |stdin_path|. |in| is not freed because 511 // Redirects |std::cin| to the file |stdin_path|. |in| is not freed because
511 // if it goes out of scope, |std::cin.rdbuf| will be freed, causing an 512 // if it goes out of scope, |std::cin.rdbuf| will be freed, causing an
512 // error. 513 // error.
513 std::ifstream* in = new std::ifstream(stdin_path.value().c_str()); 514 std::ifstream* in = new std::ifstream(stdin_path.value().c_str());
514 ASSERT_TRUE(in->is_open()); 515 ASSERT_TRUE(in->is_open());
515 std::cin.rdbuf(in->rdbuf()); 516 std::cin.rdbuf(in->rdbuf());
516 517
517 pdf_file_save_path_ = 518 pdf_file_save_path_ =
518 tmp_dir_.path().Append(FILE_PATH_LITERAL("dummy.pdf")); 519 tmp_dir_.GetPath().Append(FILE_PATH_LITERAL("dummy.pdf"));
519 520
520 // Send the file path to the layout test framework so that it can 521 // Send the file path to the layout test framework so that it can
521 // communicate with this browser test. 522 // communicate with this browser test.
522 std::cout << "StdinPath: " << stdin_path.value() << "\n"; 523 std::cout << "StdinPath: " << stdin_path.value() << "\n";
523 std::cout << "#EOF\n"; 524 std::cout << "#EOF\n";
524 std::cout.flush(); 525 std::cout.flush();
525 } 526 }
526 527
527 private: 528 private:
528 // Generates a png from bitmap data and stores it in |png_output_|. 529 // Generates a png from bitmap data and stores it in |png_output_|.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 // waiting for this message and start waiting for the image data. 640 // waiting for this message and start waiting for the image data.
640 std::cout << "#EOF\n"; 641 std::cout << "#EOF\n";
641 std::cout.flush(); 642 std::cout.flush();
642 643
643 SendPng(); 644 SendPng();
644 Reset(); 645 Reset();
645 } 646 }
646 } 647 }
647 648
648 } // namespace printing 649 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/pdf_to_emf_converter.cc ('k') | chrome/browser/printing/pwg_raster_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698