| 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 "webkit/plugins/npapi/test/plugin_geturl_test.h" | 5 #include "webkit/plugins/npapi/test/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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 break; | 180 break; |
| 181 } | 181 } |
| 182 | 182 |
| 183 // TODO(evanm): use the net:: functions to convert file:// URLs to | 183 // TODO(evanm): use the net:: functions to convert file:// URLs to |
| 184 // on-disk file paths. But it probably doesn't actually matter in | 184 // on-disk file paths. But it probably doesn't actually matter in |
| 185 // this test. | 185 // this test. |
| 186 | 186 |
| 187 #if defined(OS_WIN) | 187 #if defined(OS_WIN) |
| 188 filename = filename.substr(8); // remove "file:///" | 188 filename = filename.substr(8); // remove "file:///" |
| 189 // Assume an ASCII path on Windows. | 189 // Assume an ASCII path on Windows. |
| 190 FilePath path = FilePath(ASCIIToWide(filename)); | 190 base::FilePath path = base::FilePath(ASCIIToWide(filename)); |
| 191 #else | 191 #else |
| 192 filename = filename.substr(7); // remove "file://" | 192 filename = filename.substr(7); // remove "file://" |
| 193 FilePath path = FilePath(filename); | 193 base::FilePath path = base::FilePath(filename); |
| 194 #endif | 194 #endif |
| 195 | 195 |
| 196 test_file_ = file_util::OpenFile(path, "r"); | 196 test_file_ = file_util::OpenFile(path, "r"); |
| 197 if (!test_file_) { | 197 if (!test_file_) { |
| 198 SetError("Could not open source file"); | 198 SetError("Could not open source file"); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 break; | 201 break; |
| 202 case BOGUS_URL_STREAM_ID: | 202 case BOGUS_URL_STREAM_ID: |
| 203 SetError("Unexpected NewStream for BOGUS_URL"); | 203 SetError("Unexpected NewStream for BOGUS_URL"); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 int32_t status, | 410 int32_t status, |
| 411 void* notify_data) { | 411 void* notify_data) { |
| 412 if (!base::strcasecmp(url, "http://mock.http/npapi/plugin_read_page.html")) { | 412 if (!base::strcasecmp(url, "http://mock.http/npapi/plugin_read_page.html")) { |
| 413 received_url_redirect_notification_ = true; | 413 received_url_redirect_notification_ = true; |
| 414 // Disallow redirect notification. | 414 // Disallow redirect notification. |
| 415 HostFunctions()->urlredirectresponse(id(), notify_data, false); | 415 HostFunctions()->urlredirectresponse(id(), notify_data, false); |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 | 418 |
| 419 } // namespace NPAPIClient | 419 } // namespace NPAPIClient |
| OLD | NEW |