OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" |
6 | 6 |
7 // Clean up X11 header polution | 7 // Clean up X11 header polution |
8 #undef None | 8 #undef None |
9 #undef Bool | 9 #undef Bool |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 EXPECT_EQ(kFileName, filenames[0].path.value()); | 89 EXPECT_EQ(kFileName, filenames[0].path.value()); |
90 | 90 |
91 // We should only receive the URL here. | 91 // We should only receive the URL here. |
92 GURL out_gurl; | 92 GURL out_gurl; |
93 base::string16 out_str; | 93 base::string16 out_str; |
94 EXPECT_TRUE(provider.GetURLAndTitle(&out_gurl, &out_str)); | 94 EXPECT_TRUE(provider.GetURLAndTitle(&out_gurl, &out_str)); |
95 EXPECT_EQ(base::string16(), out_str); | 95 EXPECT_EQ(base::string16(), out_str); |
96 EXPECT_EQ(kGoogleURL, out_gurl.spec()); | 96 EXPECT_EQ(kGoogleURL, out_gurl.spec()); |
97 } | 97 } |
98 | 98 |
| 99 TEST_F(OSExchangeDataProviderAuraX11Test, OnlyStringURLIsUnfiltered) { |
| 100 const base::string16 file_url = base::UTF8ToUTF16(kFileURL); |
| 101 provider.SetString(file_url); |
| 102 |
| 103 EXPECT_TRUE(provider.HasString()); |
| 104 EXPECT_FALSE(provider.HasURL()); |
| 105 } |
| 106 |
| 107 TEST_F(OSExchangeDataProviderAuraX11Test, StringAndURIListFilterString) { |
| 108 const base::string16 file_url = base::UTF8ToUTF16(kFileURL); |
| 109 provider.SetString(file_url); |
| 110 AddURLList(kFileURL); |
| 111 |
| 112 EXPECT_FALSE(provider.HasString()); |
| 113 base::string16 out_str; |
| 114 EXPECT_FALSE(provider.GetString(&out_str)); |
| 115 |
| 116 EXPECT_TRUE(provider.HasFile()); |
| 117 } |
| 118 |
99 } // namespace ui | 119 } // namespace ui |
OLD | NEW |