| 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/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 for (int i = 0; i < 100; ++i) { | 200 for (int i = 0; i < 100; ++i) { |
| 201 base::FileEnumerator enumerator(emf_path_, false, | 201 base::FileEnumerator enumerator(emf_path_, false, |
| 202 base::FileEnumerator::FILES); | 202 base::FileEnumerator::FILES); |
| 203 emf_file.clear(); | 203 emf_file.clear(); |
| 204 prn_file.clear(); | 204 prn_file.clear(); |
| 205 found_emf = false; | 205 found_emf = false; |
| 206 found_prn = false; | 206 found_prn = false; |
| 207 base::FilePath file; | 207 base::FilePath file; |
| 208 while (!(file = enumerator.Next()).empty()) { | 208 while (!(file = enumerator.Next()).empty()) { |
| 209 std::wstring ext = file.Extension(); | 209 std::wstring ext = file.Extension(); |
| 210 if (base::strcasecmp(base::WideToUTF8(ext).c_str(), ".emf") == 0) { | 210 if (base::EqualsCaseInsensitiveASCII(base::WideToUTF8(ext), ".emf")) { |
| 211 EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << | 211 EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << |
| 212 emf_file << "\" and \"" << file.value() << | 212 emf_file << "\" and \"" << file.value() << |
| 213 "\" when looking for \"" << verification_name << "\""; | 213 "\" when looking for \"" << verification_name << "\""; |
| 214 found_emf = true; | 214 found_emf = true; |
| 215 emf_file = file.value(); | 215 emf_file = file.value(); |
| 216 continue; | 216 continue; |
| 217 } | 217 } |
| 218 if (base::strcasecmp(base::WideToUTF8(ext).c_str(), ".prn") == 0) { | 218 if (base::EqualsCaseInsensitiveASCII(base::WideToUTF8(ext), ".prn")) { |
| 219 EXPECT_FALSE(found_prn) << "Found a leftover .PRN file: \"" << | 219 EXPECT_FALSE(found_prn) << "Found a leftover .PRN file: \"" << |
| 220 prn_file << "\" and \"" << file.value() << | 220 prn_file << "\" and \"" << file.value() << |
| 221 "\" when looking for \"" << verification_name << "\""; | 221 "\" when looking for \"" << verification_name << "\""; |
| 222 prn_file = file.value(); | 222 prn_file = file.value(); |
| 223 found_prn = true; | 223 found_prn = true; |
| 224 base::DeleteFile(file, false); | 224 base::DeleteFile(file, false); |
| 225 continue; | 225 continue; |
| 226 } | 226 } |
| 227 EXPECT_TRUE(false); | 227 EXPECT_TRUE(false); |
| 228 } | 228 } |
| (...skipping 231 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 |