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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk_unittest.cc

Issue 112913004: Update some uses of UTF conversions in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 25 matching lines...) Expand all
36 guchar test_data[] = ""; 36 guchar test_data[] = "";
37 data.data = test_data; 37 data.data = test_data;
38 data.length = 0; 38 data.length = 0;
39 nodes = GetNodesFromSelection( 39 nodes = GetNodesFromSelection(
40 NULL, &data, ui::CHROME_BOOKMARK_ITEM, NULL, NULL, NULL); 40 NULL, &data, ui::CHROME_BOOKMARK_ITEM, NULL, NULL, NULL);
41 EXPECT_EQ(0u, nodes.size()); 41 EXPECT_EQ(0u, nodes.size());
42 } 42 }
43 43
44 TEST(BookmarkUtilsGtkTest, WriteBookmarkToSelectionHTML) { 44 TEST(BookmarkUtilsGtkTest, WriteBookmarkToSelectionHTML) {
45 BookmarkNode x(GURL("http://www.google.com")); 45 BookmarkNode x(GURL("http://www.google.com"));
46 x.SetTitle(base::string16(ASCIIToUTF16("Google"))); 46 x.SetTitle(base::string16(base::ASCIIToUTF16("Google")));
47 GtkSelectionData data; 47 GtkSelectionData data;
48 data.data = NULL; 48 data.data = NULL;
49 data.length = 0; 49 data.length = 0;
50 WriteBookmarkToSelection(&x, &data, ui::TEXT_HTML, NULL); 50 WriteBookmarkToSelection(&x, &data, ui::TEXT_HTML, NULL);
51 std::string selection(reinterpret_cast<char*>(data.data), data.length); 51 std::string selection(reinterpret_cast<char*>(data.data), data.length);
52 EXPECT_EQ("<a href=\"http://www.google.com/\">Google</a>", selection); 52 EXPECT_EQ("<a href=\"http://www.google.com/\">Google</a>", selection);
53 53
54 // Free the copied data in GtkSelectionData 54 // Free the copied data in GtkSelectionData
55 gtk_selection_data_set(&data, data.type, data.format, NULL, -1); 55 gtk_selection_data_set(&data, data.type, data.format, NULL, -1);
56 } 56 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc ('k') | chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698