OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/gfx/gdi_util.h" | 7 #include "base/gfx/gdi_util.h" |
8 #include "skia/ext/platform_device.h" | 8 #include "skia/ext/platform_device.h" |
9 #include "base/gfx/png_decoder.h" | 9 #include "base/gfx/png_decoder.h" |
10 #include "base/gfx/png_encoder.h" | 10 #include "base/gfx/png_encoder.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 private: | 325 private: |
326 // Verifies that there is one .emf and one .prn file in the dump directory. | 326 // Verifies that there is one .emf and one .prn file in the dump directory. |
327 // Returns the path of the .emf file and deletes the .prn file. | 327 // Returns the path of the .emf file and deletes the .prn file. |
328 std::wstring ScanFiles(const std::wstring& verification_name) { | 328 std::wstring ScanFiles(const std::wstring& verification_name) { |
329 // Try to 10 seconds. | 329 // Try to 10 seconds. |
330 std::wstring emf_file; | 330 std::wstring emf_file; |
331 std::wstring prn_file; | 331 std::wstring prn_file; |
332 bool found_emf = false; | 332 bool found_emf = false; |
333 bool found_prn = false; | 333 bool found_prn = false; |
334 for (int i = 0; i < 100; ++i) { | 334 for (int i = 0; i < 100; ++i) { |
335 file_util::FileEnumerator enumerator(emf_path(), false, | 335 file_util::FileEnumerator enumerator( |
336 file_util::FileEnumerator::FILES); | 336 FilePath::FromWStringHack(emf_path()), false, |
| 337 file_util::FileEnumerator::FILES); |
337 emf_file.clear(); | 338 emf_file.clear(); |
338 prn_file.clear(); | 339 prn_file.clear(); |
339 found_emf = false; | 340 found_emf = false; |
340 found_prn = false; | 341 found_prn = false; |
341 std::wstring file; | 342 std::wstring file; |
342 while (!(file = enumerator.Next()).empty()) { | 343 while (!(file = enumerator.Next().ToWStringHack()).empty()) { |
343 std::wstring ext = file_util::GetFileExtensionFromPath(file); | 344 std::wstring ext = file_util::GetFileExtensionFromPath(file); |
344 if (!_wcsicmp(ext.c_str(), L"emf")) { | 345 if (!_wcsicmp(ext.c_str(), L"emf")) { |
345 EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << | 346 EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << |
346 emf_file << "\" and \"" << file << "\" when looking for \"" << | 347 emf_file << "\" and \"" << file << "\" when looking for \"" << |
347 verification_name << "\""; | 348 verification_name << "\""; |
348 found_emf = true; | 349 found_emf = true; |
349 emf_file = file; | 350 emf_file = file; |
350 continue; | 351 continue; |
351 } | 352 } |
352 if (!_wcsicmp(ext.c_str(), L"prn")) { | 353 if (!_wcsicmp(ext.c_str(), L"prn")) { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 url = server.TestServerPage("files/printing/test1.html"); | 620 url = server.TestServerPage("files/printing/test1.html"); |
620 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, | 621 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
621 tab_proxy->NavigateToURL(url)); | 622 tab_proxy->NavigateToURL(url)); |
622 } | 623 } |
623 CloseBrowserAndServer(); | 624 CloseBrowserAndServer(); |
624 | 625 |
625 EXPECT_EQ(0., CompareWithResult(L"iframe")) | 626 EXPECT_EQ(0., CompareWithResult(L"iframe")) |
626 << L"iframe"; | 627 << L"iframe"; |
627 } | 628 } |
628 | 629 |
OLD | NEW |