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

Unified Diff: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk_unittest.cc

Issue 7377003: Add support for text/html to bookmarks gtk drag/drop. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add memory leak fix to test Created 9 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 | « chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk_unittest.cc
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk_unittest.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk_unittest.cc
index fa790fcef813fa7293e20f906a2f335e064e2988..af4159a1c2bd0bd956f1298a324fb3894ffd6cf1 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk_unittest.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk_unittest.cc
@@ -2,7 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <string>
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h"
+#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/dragdrop/gtk_dnd_util.h"
@@ -36,3 +40,17 @@ TEST(BookmarkUtilsGtkTest, GetNodesFromSelectionInvalid) {
ui::CHROME_BOOKMARK_ITEM, NULL, NULL, NULL);
EXPECT_EQ(0u, nodes.size());
}
+
+TEST(BookmarkUtilsGtkTest, WriteBookmarkToSelectionHTML) {
+ BookmarkNode x(GURL("http://www.google.com"));
+ x.set_title(string16(ASCIIToUTF16("Google")));
+ GtkSelectionData data;
+ data.data = NULL;
+ data.length = 0;
+ bookmark_utils::WriteBookmarkToSelection(&x, &data, ui::TEXT_HTML, NULL);
+ std::string selection(reinterpret_cast<char*>(data.data), data.length);
+ EXPECT_EQ("<a href=\"http://www.google.com/\">Google</a>", selection);
+
+ // Free the copied data in GtkSelectionData
+ gtk_selection_data_set(&data, data.type, data.format, NULL, -1);
+}
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698