summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 19:14:53 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 19:14:53 +0000
commit584cbadd3c6b02302e9694005faa47d94d141f0d (patch)
tree81b3d43c016999583cbfab7a3e804c3ff3e65180 /chrome/browser/bookmarks
parent1d106cd23824c024f631140e52666ca750f5f56d (diff)
downloadchromium_src-584cbadd3c6b02302e9694005faa47d94d141f0d.zip
chromium_src-584cbadd3c6b02302e9694005faa47d94d141f0d.tar.gz
chromium_src-584cbadd3c6b02302e9694005faa47d94d141f0d.tar.bz2
Changes bookmark html writer test to lookup string rather than hard
coding. I can't think of a good reason why we were hard coding it before. BUG=17592 TEST=none Review URL: http://codereview.chromium.org/340009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks')
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer_unittest.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
index eb9eed2..526b5d3 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
@@ -4,6 +4,7 @@
#include "testing/gtest/include/gtest/gtest.h"
+#include "app/l10n_util.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/string_util.h"
@@ -12,6 +13,7 @@
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/importer/firefox2_importer.h"
+#include "grit/generated_resources.h"
class BookmarkHTMLWriterTest : public testing::Test {
protected:
@@ -98,8 +100,7 @@ class BookmarkHTMLWriterTest : public testing::Test {
// Tests bookmark_html_writer by populating a BookmarkModel, writing it out by
// way of bookmark_html_writer, then using the importer to read it back in.
-// Flaky, http://crbug.com/17592.
-TEST_F(BookmarkHTMLWriterTest, FLAKY_Test) {
+TEST_F(BookmarkHTMLWriterTest, Test) {
// Populate the BookmarkModel. This creates the following bookmark structure:
// Bookmarks bar
// F1
@@ -158,24 +159,18 @@ TEST_F(BookmarkHTMLWriterTest, FLAKY_Test) {
// Verify we got back what we wrote.
ASSERT_EQ(7U, parsed_bookmarks.size());
- // Hardcode the value of IDS_BOOKMARK_BAR_FOLDER_NAME in en-US locale
- // because all the unit tests are run in en-US locale.
-#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
// Windows and ChromeOS builds use Sentence case.
- const wchar_t* kBookmarkBarFolderName = L"Bookmarks bar";
-#else
- // Mac and Linux + GTK uses Title Case.
- const wchar_t* kBookmarkBarFolderName = L"Bookmarks Bar";
-#endif
+ std::wstring bookmark_folder_name =
+ l10n_util::GetString(IDS_BOOMARK_BAR_FOLDER_NAME);
AssertBookmarkEntryEquals(parsed_bookmarks[0], false, url1, url1_title, t1,
- kBookmarkBarFolderName, f1_title, std::wstring());
+ bookmark_folder_name, f1_title, std::wstring());
AssertBookmarkEntryEquals(parsed_bookmarks[1], false, url2, url2_title, t2,
- kBookmarkBarFolderName, f1_title, f2_title);
+ bookmark_folder_name, f1_title, f2_title);
AssertBookmarkEntryEquals(parsed_bookmarks[2], false, url3, url3_title, t3,
- kBookmarkBarFolderName, std::wstring(),
+ bookmark_folder_name, std::wstring(),
std::wstring());
AssertBookmarkEntryEquals(parsed_bookmarks[3], false, url4, url4_title, t4,
- kBookmarkBarFolderName, std::wstring(),
+ bookmark_folder_name, std::wstring(),
std::wstring());
AssertBookmarkEntryEquals(parsed_bookmarks[4], false, url1, url1_title, t1,
std::wstring(), std::wstring(), std::wstring());