Make Windows traversal checking handle pathological cases 

Different versions of Windows have undocumented quirks in handling path components 
(e.g. truncating or ignoring certain leading or trailing characters). In order to avoid potential 
security bugs we're going to treat components more loosely and risk a few unlikely false 
positives from FilePath::ReferencesParent(). 

BUG=181617
R=brettw@chromium.org, ericu@chromium.org

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200603

Review URL: https://codereview.chromium.org/12771015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200707 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: a00f545c506242dd03df675b5d519cc822d7d666
diff --git a/base/files/file_path_unittest.cc b/base/files/file_path_unittest.cc
index dbc9244..50befdf 100644
--- a/base/files/file_path_unittest.cc
+++ b/base/files/file_path_unittest.cc
@@ -1068,6 +1068,9 @@
   const struct UnaryBooleanTestData cases[] = {
     { FPL("."),        false },
     { FPL(".."),       true },
+    { FPL(".. "),      true },
+    { FPL(" .."),      true },
+    { FPL("..."),      true },
     { FPL("a.."),      false },
     { FPL("..a"),      false },
     { FPL("../"),      true },