| 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 | 121 |
| 122 base::FilePath base_path(ui_test_utils::GetTestFilePath( | 122 base::FilePath base_path(ui_test_utils::GetTestFilePath( |
| 123 base::FilePath().AppendASCII("printing"), base::FilePath())); | 123 base::FilePath().AppendASCII("printing"), base::FilePath())); |
| 124 base::FilePath emf(base_path.Append(verification_name + L".emf")); | 124 base::FilePath emf(base_path.Append(verification_name + L".emf")); |
| 125 base::FilePath png(base_path.Append(verification_name + L".png")); | 125 base::FilePath png(base_path.Append(verification_name + L".png")); |
| 126 | 126 |
| 127 base::FilePath cleartype( | 127 base::FilePath cleartype( |
| 128 base_path.Append(verification_name + L"_cleartype.png")); | 128 base_path.Append(verification_name + L"_cleartype.png")); |
| 129 // Looks for Cleartype override. | 129 // Looks for Cleartype override. |
| 130 if (file_util::PathExists(cleartype) && IsClearTypeEnabled()) | 130 if (base::PathExists(cleartype) && IsClearTypeEnabled()) |
| 131 png = cleartype; | 131 png = cleartype; |
| 132 | 132 |
| 133 if (GenerateFiles()) { | 133 if (GenerateFiles()) { |
| 134 // Copy the .emf and generate an .png. | 134 // Copy the .emf and generate an .png. |
| 135 base::CopyFile(test_result, emf); | 135 base::CopyFile(test_result, emf); |
| 136 Image emf_content(emf); | 136 Image emf_content(emf); |
| 137 emf_content.SaveToPng(png); | 137 emf_content.SaveToPng(png); |
| 138 // Saving is always fine. | 138 // Saving is always fine. |
| 139 return 0; | 139 return 0; |
| 140 } else { | 140 } else { |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 // Force a navigation elsewhere to verify that it's fine with it. | 461 // Force a navigation elsewhere to verify that it's fine with it. |
| 462 url = test_server()->GetURL("files/printing/test1.html"); | 462 url = test_server()->GetURL("files/printing/test1.html"); |
| 463 ui_test_utils::NavigateToURL(browser(), url); | 463 ui_test_utils::NavigateToURL(browser(), url); |
| 464 } | 464 } |
| 465 chrome::CloseWindow(browser()); | 465 chrome::CloseWindow(browser()); |
| 466 content::RunAllPendingInMessageLoop(); | 466 content::RunAllPendingInMessageLoop(); |
| 467 | 467 |
| 468 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; | 468 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; |
| 469 } | 469 } |
| OLD | NEW |