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

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

Issue 22901023: linux_aura: Fix crash when dragging NTP icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude files on chromeos Created 7 years, 4 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') | ui/base/x/selection_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc
diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e5825fe5fc027897ca91e6658484bc456e2f37f1
--- /dev/null
+++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
+
+// Clean up X11 header polution
+#undef None
+#undef Bool
+
+#include "base/message_loop/message_loop.h"
+#include "base/strings/string16.h"
+#include "base/strings/utf_string_conversions.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+const char kGoogleTitle[] = "Google";
+const char kGoogleURL[] = "http://www.google.com/";
+
+TEST(OSExchangeDataProviderAuraX11Test, MozillaURL) {
+ base::MessageLoopForUI message_loop;
+ ui::OSExchangeDataProviderAuraX11 provider;
+
+ // Check that we can get titled entries.
+ provider.SetURL(GURL(kGoogleURL), ASCIIToUTF16(kGoogleTitle));
+ {
+ GURL out_gurl;
+ base::string16 out_str;
+ EXPECT_TRUE(provider.GetURLAndTitle(&out_gurl, &out_str));
+ EXPECT_EQ(ASCIIToUTF16(kGoogleTitle), out_str);
+ EXPECT_EQ(kGoogleURL, out_gurl.spec());
+ }
+
+ // Check that we can get non-titled entries.
+ provider.SetURL(GURL(kGoogleURL), string16());
+ {
+ GURL out_gurl;
+ base::string16 out_str;
+ EXPECT_TRUE(provider.GetURLAndTitle(&out_gurl, &out_str));
+ EXPECT_EQ(string16(), out_str);
+ EXPECT_EQ(kGoogleURL, out_gurl.spec());
+ }
+}
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_aurax11.cc ('k') | ui/base/x/selection_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698