Index: ui/base/dragdrop/os_exchange_data_unittest.cc |
diff --git a/ui/base/dragdrop/os_exchange_data_unittest.cc b/ui/base/dragdrop/os_exchange_data_unittest.cc |
index 8f685c8f6974823c932f26aa72c63b5eba5d44e4..02e353787a5b7c33ecb9b425e434f84cebec03f6 100644 |
--- a/ui/base/dragdrop/os_exchange_data_unittest.cc |
+++ b/ui/base/dragdrop/os_exchange_data_unittest.cc |
@@ -104,6 +104,10 @@ TEST_F(OSExchangeDataTest, TestFileToURLConversion) { |
ASSERT_TRUE(base::GetCurrentDirectory(¤t_directory)); |
data.SetFilename(current_directory); |
+ |
+// NSPasteboard does not support not converting, writing NSFilenamesPboardType |
dcheng
2014/09/10 00:22:54
We need to manually clear it in the code that read
Andre
2014/09/13 01:10:50
I couldn't find a way to clear the URL from the pa
|
+// will automatically populates URL types as well. |
+#if !defined(OS_MACOSX) |
{ |
EXPECT_FALSE(data.HasURL(OSExchangeData::DO_NOT_CONVERT_FILENAMES)); |
GURL actual_url; |
@@ -113,6 +117,8 @@ TEST_F(OSExchangeDataTest, TestFileToURLConversion) { |
EXPECT_EQ(GURL(), actual_url); |
EXPECT_EQ(base::string16(), actual_title); |
} |
+#endif |
+ |
{ |
// Filename to URL conversion is not implemented on ChromeOS or on non-X11 Linux |
// builds. |
@@ -130,7 +136,9 @@ TEST_F(OSExchangeDataTest, TestFileToURLConversion) { |
expected_success, |
data.GetURLAndTitle( |
OSExchangeData::CONVERT_FILENAMES, &actual_url, &actual_title)); |
- EXPECT_EQ(expected_url, actual_url); |
+ // Some Mac OS versions return the URL in file://localhost form instead |
+ // of file:///, so we compare the url's path not its absolute string. |
+ EXPECT_EQ(expected_url.path(), actual_url.path()); |
EXPECT_EQ(base::string16(), actual_title); |
} |
EXPECT_TRUE(data.HasFile()); |