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

Side by Side Diff: components/bookmarks/browser/bookmark_node_data_unittest.cc

Issue 2014733003: Removing parsing of text from pasteboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moving url parsing up the hierarchy Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_node_data.h" 5 #include "components/bookmarks/browser/bookmark_node_data.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 // Make sure asking for the node with a different profile returns NULL. 137 // Make sure asking for the node with a different profile returns NULL.
138 base::ScopedTempDir other_profile_dir; 138 base::ScopedTempDir other_profile_dir;
139 EXPECT_TRUE(other_profile_dir.CreateUniqueTempDir()); 139 EXPECT_TRUE(other_profile_dir.CreateUniqueTempDir());
140 EXPECT_TRUE(read_data.GetFirstNode(model(), other_profile_dir.path()) == 140 EXPECT_TRUE(read_data.GetFirstNode(model(), other_profile_dir.path()) ==
141 NULL); 141 NULL);
142 142
143 // Writing should also put the URL and title on the clipboard. 143 // Writing should also put the URL and title on the clipboard.
144 GURL read_url; 144 GURL read_url;
145 base::string16 read_title; 145 base::string16 read_title;
146 EXPECT_TRUE(data2.GetURLAndTitle( 146 EXPECT_TRUE(data2.GetURLAndTitle(ui::OSExchangeData::CONVERT_FILENAMES,
147 ui::OSExchangeData::CONVERT_FILENAMES, &read_url, &read_title)); 147 ui::OSExchangeData::PARSE_TEXT_AS_URL,
148 &read_url, &read_title));
148 EXPECT_EQ(url, read_url); 149 EXPECT_EQ(url, read_url);
149 EXPECT_EQ(title, read_title); 150 EXPECT_EQ(title, read_title);
150 } 151 }
151 152
152 // Tests writing a folder to the clipboard. 153 // Tests writing a folder to the clipboard.
153 TEST_F(BookmarkNodeDataTest, Folder) { 154 TEST_F(BookmarkNodeDataTest, Folder) {
154 const BookmarkNode* root = model()->bookmark_bar_node(); 155 const BookmarkNode* root = model()->bookmark_bar_node();
155 const BookmarkNode* g1 = model()->AddFolder(root, 0, ASCIIToUTF16("g1")); 156 const BookmarkNode* g1 = model()->AddFolder(root, 0, ASCIIToUTF16("g1"));
156 model()->AddFolder(g1, 0, ASCIIToUTF16("g11")); 157 model()->AddFolder(g1, 0, ASCIIToUTF16("g11"));
157 const BookmarkNode* g12 = model()->AddFolder(g1, 0, ASCIIToUTF16("g12")); 158 const BookmarkNode* g12 = model()->AddFolder(g1, 0, ASCIIToUTF16("g12"));
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 ASSERT_EQ(1u, read_data.size()); 399 ASSERT_EQ(1u, read_data.size());
399 400
400 // Verify that the read data contains the same meta info. 401 // Verify that the read data contains the same meta info.
401 BookmarkNode::MetaInfoMap meta_info_map = read_data.elements[0].meta_info_map; 402 BookmarkNode::MetaInfoMap meta_info_map = read_data.elements[0].meta_info_map;
402 EXPECT_EQ(2u, meta_info_map.size()); 403 EXPECT_EQ(2u, meta_info_map.size());
403 EXPECT_EQ("somevalue", meta_info_map["somekey"]); 404 EXPECT_EQ("somevalue", meta_info_map["somekey"]);
404 EXPECT_EQ("someothervalue", meta_info_map["someotherkey"]); 405 EXPECT_EQ("someothervalue", meta_info_map["someotherkey"]);
405 } 406 }
406 407
407 } // namespace bookmarks 408 } // namespace bookmarks
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698