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

Unified Diff: base/file_version_info_unittest.cc

Issue 1560027: Refactor FileVersionInfo into an interface with platform implementations. (Closed)
Patch Set: comments Created 10 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 | « base/file_version_info_mac.mm ('k') | base/file_version_info_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_version_info_unittest.cc
diff --git a/base/file_version_info_unittest.cc b/base/file_version_info_unittest.cc
index 676e950c90499acb43e33fdcdde811e4132fc06d..4e058f4c802aed58937675cfec8bd4564943fb80 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
« no previous file with comments | « base/file_version_info_mac.mm ('k') | base/file_version_info_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698