Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: ui/base/dragdrop/os_exchange_data_unittest.cc

Issue 208313009: Fix the HTML5 drag and drop demos on Linux and CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_aurax11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6087b6377a40245745be144da5deb488587e7d0f..1440c85f489551f8459fc86a83f42fb01c04393c 100644
--- a/ui/base/dragdrop/os_exchange_data_unittest.cc
+++ b/ui/base/dragdrop/os_exchange_data_unittest.cc
@@ -70,6 +70,28 @@ TEST_F(OSExchangeDataTest, TestURLExchangeFormats) {
EXPECT_EQ(url_spec, base::UTF16ToUTF8(output_string));
}
+// Test that setting the URL does not overwrite a previously set custom string.
+TEST_F(OSExchangeDataTest, URLAndString) {
+ OSExchangeData data;
+ base::string16 string = base::ASCIIToUTF16("I can has cheezburger?");
+ data.SetString(string);
+ std::string url_spec = "http://www.google.com/";
+ GURL url(url_spec);
+ base::string16 url_title = base::ASCIIToUTF16("www.google.com");
+ data.SetURL(url, url_title);
+
+ base::string16 output_string;
+ EXPECT_TRUE(data.GetString(&output_string));
+ EXPECT_EQ(string, output_string);
+
+ GURL output_url;
+ base::string16 output_title;
+ EXPECT_TRUE(data.GetURLAndTitle(
+ OSExchangeData::CONVERT_FILENAMES, &output_url, &output_title));
+ EXPECT_EQ(url_spec, output_url.spec());
+ EXPECT_EQ(url_title, output_title);
+}
+
TEST_F(OSExchangeDataTest, TestPickledData) {
const OSExchangeData::CustomFormat kTestFormat =
ui::Clipboard::GetFormatType("application/vnd.chromium.test");
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_aurax11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698