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

Unified Diff: chrome/browser/importer/importer_unittest_utils.cc

Issue 13954013: Port some importer unit tests to browser tests to be able to fully exercise the ExternalProcessImpo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes post-merge Created 7 years, 8 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/importer/importer_unittest_utils.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/importer_unittest_utils.cc
diff --git a/chrome/browser/importer/importer_unittest_utils.cc b/chrome/browser/importer/importer_unittest_utils.cc
index ff6d79646c0a0e55bba8047bc88213776fee96f5..dd0e6c0c3252e40af49c16e685948b9bf3bd6232 100644
--- a/chrome/browser/importer/importer_unittest_utils.cc
+++ b/chrome/browser/importer/importer_unittest_utils.cc
@@ -5,41 +5,14 @@
#include "chrome/browser/importer/importer_unittest_utils.h"
#include "base/utf_string_conversions.h"
-#include "chrome/test/base/testing_profile.h"
+#include "testing/gtest/include/gtest/gtest.h"
-bool EqualBookmarkEntry(const ProfileWriter::BookmarkEntry& entry,
- const BookmarkInfo& expected) {
- if (expected.in_toolbar != entry.in_toolbar ||
- expected.path_size != entry.path.size() ||
- expected.url != entry.url.spec() ||
- WideToUTF16Hack(expected.title) != entry.title)
- return false;
- for (size_t i = 0; i < expected.path_size; ++i) {
- if (WideToUTF16Hack(expected.path[i]) != entry.path[i])
- return false;
- }
- return true;
-}
-
-bool FindBookmarkEntry(const ProfileWriter::BookmarkEntry& entry,
- const BookmarkInfo* list, int list_size) {
- for (int i = 0; i < list_size; ++i) {
- if (EqualBookmarkEntry(entry, list[i]))
- return true;
- }
- return false;
-}
-
-ImporterTest::ImporterTest()
- : profile_(new TestingProfile()),
- ui_thread_(content::BrowserThread::UI, &message_loop_),
- file_thread_(content::BrowserThread::FILE, &message_loop_) {
-}
-
-ImporterTest::~ImporterTest() {
- profile_.reset(NULL);
-}
-
-void ImporterTest::SetUp() {
- ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+void TestEqualBookmarkEntry(const ProfileWriter::BookmarkEntry& entry,
+ const BookmarkInfo& expected) {
+ ASSERT_EQ(WideToUTF16Hack(expected.title), entry.title);
+ ASSERT_EQ(expected.in_toolbar, entry.in_toolbar) << entry.title;
+ ASSERT_EQ(expected.path_size, entry.path.size()) << entry.title;
+ ASSERT_EQ(expected.url, entry.url.spec()) << entry.title;
+ for (size_t i = 0; i < expected.path_size; ++i)
+ ASSERT_EQ(WideToUTF16Hack(expected.path[i]), entry.path[i]) << entry.title;
}
« no previous file with comments | « chrome/browser/importer/importer_unittest_utils.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698