| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "public/platform/FilePathConversion.h" | 5 #include "public/platform/FilePathConversion.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "public/platform/WebString.h" | 8 #include "public/platform/WebString.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "wtf/text/WTFString.h" | 10 #include "wtf/text/WTFString.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 EXPECT_FALSE(test16bitString.is8Bit()); | 33 EXPECT_FALSE(test16bitString.is8Bit()); |
| 34 EXPECT_FALSE(test16bitLatin1.is8Bit()); | 34 EXPECT_FALSE(test16bitLatin1.is8Bit()); |
| 35 | 35 |
| 36 EXPECT_EQ(FILE_PATH_LITERAL("path"), | 36 EXPECT_EQ(FILE_PATH_LITERAL("path"), |
| 37 WebStringToFilePath(test8bitString).value()); | 37 WebStringToFilePath(test8bitString).value()); |
| 38 EXPECT_EQ(pathLatin1.value(), WebStringToFilePath(test8bitLatin1).value()); | 38 EXPECT_EQ(pathLatin1.value(), WebStringToFilePath(test8bitLatin1).value()); |
| 39 EXPECT_EQ(FILE_PATH_LITERAL("path"), | 39 EXPECT_EQ(FILE_PATH_LITERAL("path"), |
| 40 WebStringToFilePath(test16bitString).value()); | 40 WebStringToFilePath(test16bitString).value()); |
| 41 EXPECT_EQ(pathLatin1.value(), WebStringToFilePath(test16bitLatin1).value()); | 41 EXPECT_EQ(pathLatin1.value(), WebStringToFilePath(test16bitLatin1).value()); |
| 42 EXPECT_EQ(pathUTF16.value(), WebStringToFilePath(test16bitUTF16).value()); | 42 EXPECT_EQ(pathUTF16.value(), WebStringToFilePath(test16bitUTF16).value()); |
| 43 |
| 44 EXPECT_STREQ("path", |
| 45 FilePathToWebString(base::FilePath(FILE_PATH_LITERAL("path"))) |
| 46 .utf8() |
| 47 .data()); |
| 48 EXPECT_STREQ(test8bitLatin1.utf8().data(), |
| 49 FilePathToWebString(pathLatin1).utf8().data()); |
| 50 EXPECT_STREQ(test16bitUTF16.utf8().data(), |
| 51 FilePathToWebString(pathUTF16).utf8().data()); |
| 43 } | 52 } |
| 44 | 53 |
| 45 } // namespace blink | 54 } // namespace blink |
| OLD | NEW |