OLD | NEW |
1 // Copyright (c) 2011 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 "content/test/plugin/plugin_geturl_test.h" | 5 #include "content/test/plugin/plugin_geturl_test.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 break; | 199 break; |
200 } | 200 } |
201 | 201 |
202 // TODO(evanm): use the net:: functions to convert file:// URLs to | 202 // TODO(evanm): use the net:: functions to convert file:// URLs to |
203 // on-disk file paths. But it probably doesn't actually matter in | 203 // on-disk file paths. But it probably doesn't actually matter in |
204 // this test. | 204 // this test. |
205 | 205 |
206 #if defined(OS_WIN) | 206 #if defined(OS_WIN) |
207 filename = filename.substr(8); // remove "file:///" | 207 filename = filename.substr(8); // remove "file:///" |
208 // Assume an ASCII path on Windows. | 208 // Assume an ASCII path on Windows. |
209 base::FilePath path = base::FilePath(base::ASCIIToWide(filename)); | 209 base::FilePath path = base::FilePath(base::ASCIIToUTF16(filename)); |
210 #else | 210 #else |
211 filename = filename.substr(7); // remove "file://" | 211 filename = filename.substr(7); // remove "file://" |
212 base::FilePath path = base::FilePath(filename); | 212 base::FilePath path = base::FilePath(filename); |
213 #endif | 213 #endif |
214 | 214 |
215 test_file_ = base::OpenFile(path, "r"); | 215 test_file_ = base::OpenFile(path, "r"); |
216 if (!test_file_) { | 216 if (!test_file_) { |
217 SetError("Could not open source file"); | 217 SetError("Could not open source file"); |
218 } | 218 } |
219 } | 219 } |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 id(), REDIRECT_SRC_URL, NULL, | 468 id(), REDIRECT_SRC_URL, NULL, |
469 reinterpret_cast<void*>(REDIRECT_SRC_URL_NOTIFICATION_ALLOW_ID)); | 469 reinterpret_cast<void*>(REDIRECT_SRC_URL_NOTIFICATION_ALLOW_ID)); |
470 } | 470 } |
471 } else if (stream_id == REDIRECT_SRC_URL_NOTIFICATION_ALLOW_ID) { | 471 } else if (stream_id == REDIRECT_SRC_URL_NOTIFICATION_ALLOW_ID) { |
472 received_url_redirect_allow_notification_ = true; | 472 received_url_redirect_allow_notification_ = true; |
473 HostFunctions()->urlredirectresponse(id(), notify_data, true); | 473 HostFunctions()->urlredirectresponse(id(), notify_data, true); |
474 } | 474 } |
475 } | 475 } |
476 | 476 |
477 } // namespace NPAPIClient | 477 } // namespace NPAPIClient |
OLD | NEW |