diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 01:46:43 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 01:46:43 +0000 |
commit | bcff05af3d60df10a21e07751a14b95ce9e7f3d4 (patch) | |
tree | 76d8d3ec6c6c0d9564c675d423907e29607bf253 /base/file_version_info_unittest.cc | |
parent | 474b2ab8c3b32c07692480aa234f3b2921fe5dd6 (diff) | |
download | chromium_src-bcff05af3d60df10a21e07751a14b95ce9e7f3d4.zip chromium_src-bcff05af3d60df10a21e07751a14b95ce9e7f3d4.tar.gz chromium_src-bcff05af3d60df10a21e07751a14b95ce9e7f3d4.tar.bz2 |
Refactor FileVersionInfo into an interface with platform implementations.
This allows us to move the chrome specific version informaton used by
Linux into src/chrome.
Add a GetChromeVersionInfo() for Linux in src/chrome/app/ and make sure to use this in src/chrome.
In src/webkit/glue, add a new glue method for getting the product version. When compiling chrome, use an implementation in src/chrome/renderer (which uses GetChromeVersionInfo()) and a stub implementation for test_shell.
Review URL: http://codereview.chromium.org/1560027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_version_info_unittest.cc')
-rw-r--r-- | base/file_version_info_unittest.cc | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/base/file_version_info_unittest.cc b/base/file_version_info_unittest.cc index 676e950..4e058f4 100644 --- a/base/file_version_info_unittest.cc +++ b/base/file_version_info_unittest.cc @@ -8,6 +8,10 @@ #include "base/file_version_info.h" #include "testing/gtest/include/gtest/gtest.h" +#if defined(OS_WIN) +#include "base/file_version_info_win.h" +#endif + namespace { class FileVersionInfoTest : public testing::Test { @@ -24,7 +28,7 @@ FilePath GetTestDataPath() { } -#ifdef OS_WIN +#if defined(OS_WIN) TEST(FileVersionInfoTest, HardCodedProperties) { const wchar_t* kDLLNames[] = { L"FileVersionInfoTest1.dll" @@ -76,7 +80,7 @@ TEST(FileVersionInfoTest, HardCodedProperties) { } #endif -#ifdef OS_WIN +#if defined(OS_WIN) TEST(FileVersionInfoTest, IsOfficialBuild) { const wchar_t* kDLLNames[] = { L"FileVersionInfoTest1.dll", @@ -103,6 +107,7 @@ TEST(FileVersionInfoTest, IsOfficialBuild) { } #endif +#if defined(OS_WIN) TEST(FileVersionInfoTest, CustomProperties) { FilePath dll_path = GetTestDataPath(); dll_path = dll_path.AppendASCII("FileVersionInfoTest1.dll"); @@ -112,22 +117,23 @@ TEST(FileVersionInfoTest, CustomProperties) { // Test few existing properties. std::wstring str; -#ifdef OS_WIN - EXPECT_TRUE(version_info->GetValue(L"Custom prop 1", &str)); + FileVersionInfoWin* version_info_win = + static_cast<FileVersionInfoWin*>(version_info.get()); + EXPECT_TRUE(version_info_win->GetValue(L"Custom prop 1", &str)); EXPECT_EQ(L"Un", str); - EXPECT_EQ(L"Un", version_info->GetStringValue(L"Custom prop 1")); + EXPECT_EQ(L"Un", version_info_win->GetStringValue(L"Custom prop 1")); - EXPECT_TRUE(version_info->GetValue(L"Custom prop 2", &str)); + EXPECT_TRUE(version_info_win->GetValue(L"Custom prop 2", &str)); EXPECT_EQ(L"Deux", str); - EXPECT_EQ(L"Deux", version_info->GetStringValue(L"Custom prop 2")); + EXPECT_EQ(L"Deux", version_info_win->GetStringValue(L"Custom prop 2")); - EXPECT_TRUE(version_info->GetValue(L"Custom prop 3", &str)); + EXPECT_TRUE(version_info_win->GetValue(L"Custom prop 3", &str)); EXPECT_EQ(L"1600 Amphitheatre Parkway Mountain View, CA 94043", str); EXPECT_EQ(L"1600 Amphitheatre Parkway Mountain View, CA 94043", - version_info->GetStringValue(L"Custom prop 3")); -#endif + version_info_win->GetStringValue(L"Custom prop 3")); // Test an non-existing property. - EXPECT_FALSE(version_info->GetValue(L"Unknown property", &str)); - EXPECT_EQ(L"", version_info->GetStringValue(L"Unknown property")); + EXPECT_FALSE(version_info_win->GetValue(L"Unknown property", &str)); + EXPECT_EQ(L"", version_info_win->GetStringValue(L"Unknown property")); } +#endif |