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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 true, | 611 true, |
612 "", | 612 "", |
613 false, | 613 false, |
614 false, | 614 false, |
615 DEFAULT_MARGINS, | 615 DEFAULT_MARGINS, |
616 cmd.find(file_extension) != base::FilePath::StringType::npos); | 616 cmd.find(file_extension) != base::FilePath::StringType::npos); |
617 | 617 |
618 // Splits the command sent by the layout test framework. The first command | 618 // Splits the command sent by the layout test framework. The first command |
619 // is always the file path to use for the test. The rest isn't relevant, | 619 // is always the file path to use for the test. The rest isn't relevant, |
620 // so it can be ignored. The separator for the commands is an apostrophe. | 620 // so it can be ignored. The separator for the commands is an apostrophe. |
621 std::vector<base::FilePath::StringType> cmd_arguments; | 621 std::vector<base::FilePath::StringType> cmd_arguments = base::SplitString( |
622 base::SplitString(cmd, '\'', &cmd_arguments); | 622 cmd, base::FilePath::StringType(1, '\''), |
| 623 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
623 | 624 |
624 ASSERT_GE(cmd_arguments.size(), 1U); | 625 ASSERT_GE(cmd_arguments.size(), 1U); |
625 base::FilePath::StringType test_name(cmd_arguments[0]); | 626 base::FilePath::StringType test_name(cmd_arguments[0]); |
626 NavigateAndPrint(test_name, settings); | 627 NavigateAndPrint(test_name, settings); |
627 PdfToPng(); | 628 PdfToPng(); |
628 | 629 |
629 // Message to the layout test framework indicating that it should start | 630 // Message to the layout test framework indicating that it should start |
630 // waiting for the image data, as there is no more text data to be read. | 631 // waiting for the image data, as there is no more text data to be read. |
631 // There actually isn't any text data at all, however because the layout | 632 // There actually isn't any text data at all, however because the layout |
632 // test framework requires it, a message has to be sent to stop it from | 633 // test framework requires it, a message has to be sent to stop it from |
633 // waiting for this message and start waiting for the image data. | 634 // waiting for this message and start waiting for the image data. |
634 std::cout << "#EOF\n"; | 635 std::cout << "#EOF\n"; |
635 std::cout.flush(); | 636 std::cout.flush(); |
636 | 637 |
637 SendPng(); | 638 SendPng(); |
638 Reset(); | 639 Reset(); |
639 } | 640 } |
640 } | 641 } |
641 | 642 |
642 } // namespace printing | 643 } // namespace printing |
OLD | NEW |