| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "testing/platform_test.h" | 10 #include "testing/platform_test.h" |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 for (size_t i = 0; i < arraysize(cases); ++i) { | 478 for (size_t i = 0; i < arraysize(cases); ++i) { |
| 479 FilePath parent(cases[i].inputs[0]); | 479 FilePath parent(cases[i].inputs[0]); |
| 480 FilePath child(cases[i].inputs[1]); | 480 FilePath child(cases[i].inputs[1]); |
| 481 | 481 |
| 482 EXPECT_EQ(parent.IsParent(child), cases[i].expected) << | 482 EXPECT_EQ(parent.IsParent(child), cases[i].expected) << |
| 483 "i: " << i << ", parent: " << parent.value() << ", child: " << | 483 "i: " << i << ", parent: " << parent.value() << ", child: " << |
| 484 child.value(); | 484 child.value(); |
| 485 } | 485 } |
| 486 } | 486 } |
| 487 | 487 |
| 488 TEST_F(FilePathTest, AppendRelativePathTest) { | 488 TEST_F(FilePathTest, DISABLED_AppendRelativePathTest) { |
| 489 const struct BinaryTestData cases[] = { | 489 const struct BinaryTestData cases[] = { |
| 490 { { FPL("/"), FPL("/foo/bar/baz") }, FPL("foo/bar/baz")}, | 490 { { FPL("/"), FPL("/foo/bar/baz") }, FPL("foo/bar/baz")}, |
| 491 { { FPL("/foo/bar"), FPL("/foo/bar/baz") }, FPL("baz")}, | 491 { { FPL("/foo/bar"), FPL("/foo/bar/baz") }, FPL("baz")}, |
| 492 { { FPL("/foo/bar/"), FPL("/foo/bar/baz") }, FPL("baz")}, | 492 { { FPL("/foo/bar/"), FPL("/foo/bar/baz") }, FPL("baz")}, |
| 493 { { FPL("//foo/bar/"), FPL("//foo/bar/baz") }, FPL("baz")}, | 493 { { FPL("//foo/bar/"), FPL("//foo/bar/baz") }, FPL("baz")}, |
| 494 { { FPL("/foo/bar"), FPL("/foo2/bar/baz") }, FPL("")}, | 494 { { FPL("/foo/bar"), FPL("/foo2/bar/baz") }, FPL("")}, |
| 495 { { FPL("/foo/bar.txt"), FPL("/foo/bar/baz") }, FPL("")}, | 495 { { FPL("/foo/bar.txt"), FPL("/foo/bar/baz") }, FPL("")}, |
| 496 { { FPL("/foo/bar"), FPL("/foo/bar2/baz") }, FPL("")}, | 496 { { FPL("/foo/bar"), FPL("/foo/bar2/baz") }, FPL("")}, |
| 497 { { FPL("/foo/bar"), FPL("/foo/bar") }, FPL("")}, | 497 { { FPL("/foo/bar"), FPL("/foo/bar") }, FPL("")}, |
| 498 { { FPL("/foo/bar/baz"), FPL("/foo/bar") }, FPL("")}, | 498 { { FPL("/foo/bar/baz"), FPL("/foo/bar") }, FPL("")}, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 }; | 828 }; |
| 829 | 829 |
| 830 for (size_t i = 0; i < arraysize(cases); ++i) { | 830 for (size_t i = 0; i < arraysize(cases); ++i) { |
| 831 FilePath input(cases[i].input); | 831 FilePath input(cases[i].input); |
| 832 bool observed = input.ReferencesParent(); | 832 bool observed = input.ReferencesParent(); |
| 833 EXPECT_EQ(cases[i].expected, observed) << | 833 EXPECT_EQ(cases[i].expected, observed) << |
| 834 "i: " << i << ", input: " << input.value(); | 834 "i: " << i << ", input: " << input.value(); |
| 835 } | 835 } |
| 836 } | 836 } |
| 837 | 837 |
| OLD | NEW |