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 "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 }, | 1398 }, |
1399 { // Filename disappears after leading and trailing periods are removed. | 1399 { // Filename disappears after leading and trailing periods are removed. |
1400 "http://www.google.com/", | 1400 "http://www.google.com/", |
1401 "Content-disposition: attachment; filename=\"..\"", | 1401 "Content-disposition: attachment; filename=\"..\"", |
1402 "", | 1402 "", |
1403 "", | 1403 "", |
1404 "", | 1404 "", |
1405 L"default", | 1405 L"default", |
1406 L"default" | 1406 L"default" |
1407 }, | 1407 }, |
1408 { // C-D specified filename disappears. Should use last component of URL | 1408 { // C-D specified filename disappears. Failover to final filename. |
1409 // instead. | |
1410 "http://www.google.com/test.html", | 1409 "http://www.google.com/test.html", |
1411 "Content-disposition: attachment; filename=\"..\"", | 1410 "Content-disposition: attachment; filename=\"..\"", |
1412 "", | 1411 "", |
1413 "", | 1412 "", |
1414 "", | 1413 "", |
1415 L"download", | 1414 L"default", |
1416 L"test.html" | 1415 L"default" |
1417 }, | 1416 }, |
1418 // Below is a small subset of cases taken from GetFileNameFromCD test above. | 1417 // Below is a small subset of cases taken from GetFileNameFromCD test above. |
1419 { | 1418 { |
1420 "http://www.google.com/", | 1419 "http://www.google.com/", |
1421 "Content-Disposition: attachment; filename=\"%EC%98%88%EC%88%A0%20" | 1420 "Content-Disposition: attachment; filename=\"%EC%98%88%EC%88%A0%20" |
1422 "%EC%98%88%EC%88%A0.jpg\"", | 1421 "%EC%98%88%EC%88%A0.jpg\"", |
1423 "", | 1422 "", |
1424 "", | 1423 "", |
1425 "", | 1424 "", |
1426 L"", | 1425 L"", |
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3321 if (it->address[i] != 0) { | 3320 if (it->address[i] != 0) { |
3322 all_zeroes = false; | 3321 all_zeroes = false; |
3323 break; | 3322 break; |
3324 } | 3323 } |
3325 } | 3324 } |
3326 EXPECT_FALSE(all_zeroes); | 3325 EXPECT_FALSE(all_zeroes); |
3327 } | 3326 } |
3328 } | 3327 } |
3329 | 3328 |
3330 } // namespace net | 3329 } // namespace net |
OLD | NEW |