| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <sstream> |
| 6 |
| 5 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 6 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
| 10 | 12 |
| 11 // This macro helps avoid wrapped lines in the test structs. | 13 // This macro helps avoid wrapped lines in the test structs. |
| 12 #define FPL(x) FILE_PATH_LITERAL(x) | 14 #define FPL(x) FILE_PATH_LITERAL(x) |
| 13 | 15 |
| 14 // This macro constructs strings which can contain NULs. | 16 // This macro constructs strings which can contain NULs. |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 | 1268 |
| 1267 for (size_t i = 0; i < arraysize(cases); ++i) { | 1269 for (size_t i = 0; i < arraysize(cases); ++i) { |
| 1268 FilePath input(cases[i].input); | 1270 FilePath input(cases[i].input); |
| 1269 bool observed = input.IsContentUri(); | 1271 bool observed = input.IsContentUri(); |
| 1270 EXPECT_EQ(cases[i].expected, observed) << | 1272 EXPECT_EQ(cases[i].expected, observed) << |
| 1271 "i: " << i << ", input: " << input.value(); | 1273 "i: " << i << ", input: " << input.value(); |
| 1272 } | 1274 } |
| 1273 } | 1275 } |
| 1274 #endif | 1276 #endif |
| 1275 | 1277 |
| 1278 // Test the PrintTo overload for FilePath (used when a test fails to compare two |
| 1279 // FilePaths). |
| 1280 TEST_F(FilePathTest, PrintTo) { |
| 1281 std::stringstream ss; |
| 1282 FilePath fp(FPL("foo")); |
| 1283 base::PrintTo(fp, &ss); |
| 1284 EXPECT_EQ("foo", ss.str()); |
| 1285 } |
| 1286 |
| 1276 } // namespace base | 1287 } // namespace base |
| OLD | NEW |