OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_path.h" | |
6 #include "base/file_util.h" | 7 #include "base/file_util.h" |
7 #include "base/test/test_file_util.h" | 8 #include "base/test/test_file_util.h" |
8 #include "base/threading/simple_thread.h" | 9 #include "base/threading/simple_thread.h" |
9 #include "chrome/test/automation/tab_proxy.h" | 10 #include "chrome/test/automation/tab_proxy.h" |
10 #include "chrome/test/ui/ui_test.h" | 11 #include "chrome/test/ui/ui_test.h" |
11 #include "net/test/test_server.h" | 12 #include "net/test/test_server.h" |
12 #include "printing/image.h" | 13 #include "printing/image.h" |
13 #include "printing/printing_test.h" | 14 #include "printing/printing_test.h" |
14 | 15 |
15 namespace { | 16 namespace { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 bool found_prn = false; | 136 bool found_prn = false; |
136 for (int i = 0; i < 100; ++i) { | 137 for (int i = 0; i < 100; ++i) { |
137 file_util::FileEnumerator enumerator(emf_path(), false, | 138 file_util::FileEnumerator enumerator(emf_path(), false, |
138 file_util::FileEnumerator::FILES); | 139 file_util::FileEnumerator::FILES); |
139 emf_file.clear(); | 140 emf_file.clear(); |
140 prn_file.clear(); | 141 prn_file.clear(); |
141 found_emf = false; | 142 found_emf = false; |
142 found_prn = false; | 143 found_prn = false; |
143 std::wstring file; | 144 std::wstring file; |
144 while (!(file = enumerator.Next().ToWStringHack()).empty()) { | 145 while (!(file = enumerator.Next().ToWStringHack()).empty()) { |
145 std::wstring ext = file_util::GetFileExtensionFromPath(file); | 146 std::wstring ext = FilePath(file).Extension(); |
146 if (!_wcsicmp(ext.c_str(), L"emf")) { | 147 if (!_wcsicmp(ext.c_str(), L".emf")) { |
Evan Martin
2011/01/26 20:10:21
I suggesting these to use the pattern found in the
tfarina
2011/01/26 20:21:26
Done.
Evan, a question:
The description for wcsic
| |
147 EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << | 148 EXPECT_FALSE(found_emf) << "Found a leftover .EMF file: \"" << |
148 emf_file << "\" and \"" << file << "\" when looking for \"" << | 149 emf_file << "\" and \"" << file << "\" when looking for \"" << |
149 verification_name << "\""; | 150 verification_name << "\""; |
150 found_emf = true; | 151 found_emf = true; |
151 emf_file = file; | 152 emf_file = file; |
152 continue; | 153 continue; |
153 } | 154 } |
154 if (!_wcsicmp(ext.c_str(), L"prn")) { | 155 if (!_wcsicmp(ext.c_str(), L".prn")) { |
155 EXPECT_FALSE(found_prn) << "Found a leftover .PRN file: \"" << | 156 EXPECT_FALSE(found_prn) << "Found a leftover .PRN file: \"" << |
156 prn_file << "\" and \"" << file << "\" when looking for \"" << | 157 prn_file << "\" and \"" << file << "\" when looking for \"" << |
157 verification_name << "\""; | 158 verification_name << "\""; |
158 prn_file = file; | 159 prn_file = file; |
159 found_prn = true; | 160 found_prn = true; |
160 file_util::Delete(file, false); | 161 file_util::Delete(file, false); |
161 continue; | 162 continue; |
162 } | 163 } |
163 EXPECT_TRUE(false); | 164 EXPECT_TRUE(false); |
164 } | 165 } |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 | 415 |
415 // Force a navigation elsewhere to verify that it's fine with it. | 416 // Force a navigation elsewhere to verify that it's fine with it. |
416 url = test_server.GetURL("files/printing/test1.html"); | 417 url = test_server.GetURL("files/printing/test1.html"); |
417 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, | 418 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
418 tab_proxy->NavigateToURL(url)); | 419 tab_proxy->NavigateToURL(url)); |
419 } | 420 } |
420 CloseBrowserAndServer(); | 421 CloseBrowserAndServer(); |
421 | 422 |
422 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; | 423 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; |
423 } | 424 } |
OLD | NEW |