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

Side by Side Diff: chrome/browser/importer/firefox_importer_unittest.cc

Issue 126036: Patch to solve the problem in import export bookmarks (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/importer/firefox2_importer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/browser/importer/firefox2_importer.h" 10 #include "chrome/browser/importer/firefox2_importer.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 result = Firefox2Importer::ParseBookmarkFromLine( 99 result = Firefox2Importer::ParseBookmarkFromLine(
100 "<DT><A HREF=\"http://domain.com/?q=%22<>%22\">name</A>", 100 "<DT><A HREF=\"http://domain.com/?q=%22<>%22\">name</A>",
101 charset, &title, &url, &favicon, &shortcut, &add_date, &post_data); 101 charset, &title, &url, &favicon, &shortcut, &add_date, &post_data);
102 EXPECT_TRUE(result); 102 EXPECT_TRUE(result);
103 EXPECT_EQ(L"name", title); 103 EXPECT_EQ(L"name", title);
104 EXPECT_EQ("http://domain.com/?q=%22%3C%3E%22", url.spec()); 104 EXPECT_EQ("http://domain.com/?q=%22%3C%3E%22", url.spec());
105 EXPECT_EQ(L"", shortcut); 105 EXPECT_EQ(L"", shortcut);
106 EXPECT_EQ(L"", post_data); 106 EXPECT_EQ(L"", post_data);
107 EXPECT_TRUE(Time() == add_date); 107 EXPECT_TRUE(Time() == add_date);
108 108
109 result = Firefox2Importer::ParseBookmarkFromLine(
110 "<DT><A HREF=\"http://domain.com/?g=&quot;\"\">name</A>",
111 charset, &title, &url, &favicon, &shortcut, &add_date, &post_data);
112 EXPECT_TRUE(result);
113 EXPECT_EQ(L"name", title);
114 EXPECT_EQ("http://domain.com/?g=%22", url.spec());
115 EXPECT_EQ(L"", shortcut);
116 EXPECT_EQ(L"", post_data);
117 EXPECT_TRUE(Time() == add_date);
118
109 // Creation date. 119 // Creation date.
110 result = Firefox2Importer::ParseBookmarkFromLine( 120 result = Firefox2Importer::ParseBookmarkFromLine(
111 "<DT><A HREF=\"http://site/\" ADD_DATE=\"1121301154\">name</A>", 121 "<DT><A HREF=\"http://site/\" ADD_DATE=\"1121301154\">name</A>",
112 charset, &title, &url, &favicon, &shortcut, &add_date, &post_data); 122 charset, &title, &url, &favicon, &shortcut, &add_date, &post_data);
113 EXPECT_TRUE(result); 123 EXPECT_TRUE(result);
114 EXPECT_EQ(L"name", title); 124 EXPECT_EQ(L"name", title);
115 EXPECT_EQ(GURL("http://site/"), url); 125 EXPECT_EQ(GURL("http://site/"), url);
116 EXPECT_EQ(L"", shortcut); 126 EXPECT_EQ(L"", shortcut);
117 EXPECT_EQ(L"", post_data); 127 EXPECT_EQ(L"", post_data);
118 EXPECT_TRUE(Time::FromTimeT(1121301154) == add_date); 128 EXPECT_TRUE(Time::FromTimeT(1121301154) == add_date);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 EXPECT_FALSE(lock2->HasAcquired()); 221 EXPECT_FALSE(lock2->HasAcquired());
212 222
213 lock1->Unlock(); 223 lock1->Unlock();
214 EXPECT_FALSE(lock1->HasAcquired()); 224 EXPECT_FALSE(lock1->HasAcquired());
215 225
216 lock2->Lock(); 226 lock2->Lock();
217 EXPECT_TRUE(lock2->HasAcquired()); 227 EXPECT_TRUE(lock2->HasAcquired());
218 lock2->Unlock(); 228 lock2->Unlock();
219 EXPECT_FALSE(lock2->HasAcquired()); 229 EXPECT_FALSE(lock2->HasAcquired());
220 } 230 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/firefox2_importer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698