diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 00:10:48 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-06 00:10:48 +0000 |
commit | df6725ea98d03df12c59cfcaadaf921ff47180c7 (patch) | |
tree | eba747b1415aa994400263a85b2daa113f0b03a1 /chrome/installer/util/google_chrome_distribution_unittest.cc | |
parent | a5b9781b827724254c9440920db40248a50d6dad (diff) | |
download | chromium_src-df6725ea98d03df12c59cfcaadaf921ff47180c7.zip chromium_src-df6725ea98d03df12c59cfcaadaf921ff47180c7.tar.gz chromium_src-df6725ea98d03df12c59cfcaadaf921ff47180c7.tar.bz2 |
Add first_run_tabs to the master prefs file
- Updated unit test
BUG=http://code.google.com/p/chromium/issues/detail?id=9706
TEST=none. Unit test included.
Review URL: http://codereview.chromium.org/100364
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/google_chrome_distribution_unittest.cc')
-rw-r--r-- | chrome/installer/util/google_chrome_distribution_unittest.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/installer/util/google_chrome_distribution_unittest.cc b/chrome/installer/util/google_chrome_distribution_unittest.cc index 9339f0c..5e3a71e 100644 --- a/chrome/installer/util/google_chrome_distribution_unittest.cc +++ b/chrome/installer/util/google_chrome_distribution_unittest.cc @@ -300,3 +300,28 @@ TEST(MasterPreferences, ParseDistroParams) { EXPECT_TRUE(result & installer_util::MASTER_PROFILE_ALT_SHORTCUT_TXT); EXPECT_TRUE(file_util::Delete(prefs, false)); } + +TEST(MasterPreferences, FirstRunTabs) { + std::wstring prefs; + ASSERT_TRUE(file_util::CreateTemporaryFileName(&prefs)); + const char text[] = + "{ \n" + " \"distribution\": { \n" + " \"something here\": true\n" + " },\n" + " \"first_run_tabs\": [\n" + " \"http://google.com/f1\",\n" + " \"https://google.com/f2\",\n" + " \"new_tab_page\"\n" + " ]\n" + "} \n"; + + EXPECT_TRUE(file_util::WriteFile(prefs, text, sizeof(text))); + typedef std::vector<std::wstring> TabsVector; + TabsVector tabs = installer_util::ParseFirstRunTabs(prefs); + ASSERT_EQ(3, tabs.size()); + EXPECT_EQ(L"http://google.com/f1", tabs[0]); + EXPECT_EQ(L"https://google.com/f2", tabs[1]); + EXPECT_EQ(L"new_tab_page", tabs[2]); + EXPECT_TRUE(file_util::Delete(prefs, false)); +} |