Commit 584cbadd authored by sky@chromium.org's avatar sky@chromium.org

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
parent 1d106cd2
......@@ -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());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment