| 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 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1850       L"evil" | 1850       L"evil" | 
| 1851     }, | 1851     }, | 
| 1852     // Test truncation of trailing dots and spaces | 1852     // Test truncation of trailing dots and spaces | 
| 1853     { | 1853     { | 
| 1854       "http://www.goodguy.com/evil.exe ", | 1854       "http://www.goodguy.com/evil.exe ", | 
| 1855       "Content-Dispostion: filename=evil.exe ", | 1855       "Content-Dispostion: filename=evil.exe ", | 
| 1856       "", | 1856       "", | 
| 1857       "", | 1857       "", | 
| 1858       "binary/octet-stream", | 1858       "binary/octet-stream", | 
| 1859       L"download", | 1859       L"download", | 
| 1860       L"evil.exe" | 1860       L"evil.exe-" | 
| 1861     }, | 1861     }, | 
| 1862     { | 1862     { | 
| 1863       "http://www.goodguy.com/evil.exe.", | 1863       "http://www.goodguy.com/evil.exe.", | 
| 1864       "Content-Dispostion: filename=evil.exe.", | 1864       "Content-Dispostion: filename=evil.exe.", | 
| 1865       "", | 1865       "", | 
| 1866       "", | 1866       "", | 
| 1867       "binary/octet-stream", | 1867       "binary/octet-stream", | 
| 1868       L"download", | 1868       L"download", | 
| 1869       L"evil.exe" | 1869       L"evil.exe-" | 
| 1870     }, | 1870     }, | 
| 1871     { | 1871     { | 
| 1872       "http://www.goodguy.com/evil.exe.  .  .", | 1872       "http://www.goodguy.com/evil.exe.  .  .", | 
| 1873       "Content-Dispostion: filename=evil.exe.  .  .", | 1873       "Content-Dispostion: filename=evil.exe.  .  .", | 
| 1874       "", | 1874       "", | 
| 1875       "", | 1875       "", | 
| 1876       "binary/octet-stream", | 1876       "binary/octet-stream", | 
| 1877       L"download", | 1877       L"download", | 
| 1878       L"evil.exe" | 1878       L"evil.exe-------" | 
| 1879     }, | 1879     }, | 
| 1880     { | 1880     { | 
| 1881       "http://www.goodguy.com/evil.", | 1881       "http://www.goodguy.com/evil.", | 
| 1882       "Content-Dispostion: filename=evil.", | 1882       "Content-Dispostion: filename=evil.", | 
| 1883       "", | 1883       "", | 
| 1884       "", | 1884       "", | 
| 1885       "binary/octet-stream", | 1885       "binary/octet-stream", | 
| 1886       L"download", | 1886       L"download", | 
| 1887       L"evil" | 1887       L"evil-" | 
| 1888     }, | 1888     }, | 
| 1889     { | 1889     { | 
| 1890       "http://www.goodguy.com/. . . . .", | 1890       "http://www.goodguy.com/. . . . .", | 
| 1891       "Content-Dispostion: filename=. . . . .", | 1891       "Content-Dispostion: filename=. . . . .", | 
| 1892       "", | 1892       "", | 
| 1893       "", | 1893       "", | 
| 1894       "binary/octet-stream", | 1894       "binary/octet-stream", | 
| 1895       L"download", | 1895       L"download", | 
| 1896       L"download" | 1896       L"download" | 
| 1897     }, | 1897     }, | 
|  | 1898     { | 
|  | 1899       "http://www.badguy.com/attachment?name=meh.exe%C2%A0", | 
|  | 1900       "attachment; filename=\"meh.exe\xC2\xA0\"", | 
|  | 1901       "", | 
|  | 1902       "", | 
|  | 1903       "binary/octet-stream", | 
|  | 1904       L"", | 
|  | 1905       L"meh.exe-" | 
|  | 1906     }, | 
| 1898 #endif  // OS_WIN | 1907 #endif  // OS_WIN | 
| 1899     { | 1908     { | 
| 1900       "http://www.goodguy.com/utils.js", | 1909       "http://www.goodguy.com/utils.js", | 
| 1901       "Content-Dispostion: filename=utils.js", | 1910       "Content-Dispostion: filename=utils.js", | 
| 1902       "", | 1911       "", | 
| 1903       "", | 1912       "", | 
| 1904       "application/x-javascript", | 1913       "application/x-javascript", | 
| 1905       L"download", | 1914       L"download", | 
| 1906       L"utils.js" | 1915       L"utils.js" | 
| 1907     }, | 1916     }, | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1986       L"download", | 1995       L"download", | 
| 1987       L"hidden" TXT_EXT | 1996       L"hidden" TXT_EXT | 
| 1988     }, | 1997     }, | 
| 1989     { | 1998     { | 
| 1990       "http://www.evil.com/trailing.", | 1999       "http://www.evil.com/trailing.", | 
| 1991       "Content-Disposition: filename=trailing.", | 2000       "Content-Disposition: filename=trailing.", | 
| 1992       "", | 2001       "", | 
| 1993       "", | 2002       "", | 
| 1994       "dance/party", | 2003       "dance/party", | 
| 1995       L"download", | 2004       L"download", | 
|  | 2005 #if defined(OS_WIN) | 
|  | 2006       L"trailing-" | 
|  | 2007 #else | 
| 1996       L"trailing" | 2008       L"trailing" | 
|  | 2009 #endif //OS_WIN | 
| 1997     }, | 2010     }, | 
| 1998     { | 2011     { | 
| 1999       "http://www.evil.com/trailing.", | 2012       "http://www.evil.com/trailing.", | 
| 2000       "Content-Disposition: filename=trailing.", | 2013       "Content-Disposition: filename=trailing.", | 
| 2001       "", | 2014       "", | 
| 2002       "", | 2015       "", | 
| 2003       "text/plain", | 2016       "text/plain", | 
| 2004       L"download", | 2017       L"download", | 
|  | 2018 #if defined(OS_WIN) | 
|  | 2019       L"trailing-" TXT_EXT | 
|  | 2020 #else | 
| 2005       L"trailing" TXT_EXT | 2021       L"trailing" TXT_EXT | 
|  | 2022 #endif //OS_WIN | 
| 2006     }, | 2023     }, | 
| 2007     { | 2024     { | 
| 2008       "http://www.evil.com/.", | 2025       "http://www.evil.com/.", | 
| 2009       "Content-Dispostion: filename=.", | 2026       "Content-Dispostion: filename=.", | 
| 2010       "", | 2027       "", | 
| 2011       "", | 2028       "", | 
| 2012       "dance/party", | 2029       "dance/party", | 
| 2013       L"download", | 2030       L"download", | 
| 2014       L"download" | 2031       L"download" | 
| 2015     }, | 2032     }, | 
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3321       if (it->address[i] != 0) { | 3338       if (it->address[i] != 0) { | 
| 3322         all_zeroes = false; | 3339         all_zeroes = false; | 
| 3323         break; | 3340         break; | 
| 3324       } | 3341       } | 
| 3325     } | 3342     } | 
| 3326     EXPECT_FALSE(all_zeroes); | 3343     EXPECT_FALSE(all_zeroes); | 
| 3327   } | 3344   } | 
| 3328 } | 3345 } | 
| 3329 | 3346 | 
| 3330 }  // namespace net | 3347 }  // namespace net | 
| OLD | NEW | 
|---|