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

Unified Diff: chrome/common/chrome_constants_win_unittest.cc

Issue 2656443002: Use chrome::kChromeVersion in installer::GetModulePath(). (Closed)
Patch Set: rebase Created 3 years, 10 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 | « chrome/app/main_dll_loader_win.cc ('k') | chrome/installer/util/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_constants_win_unittest.cc
diff --git a/chrome/common/chrome_constants_win_unittest.cc b/chrome/common/chrome_constants_win_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0e5bd0f996b3f6714bd01f3670bf9d043ea755bc
--- /dev/null
+++ b/chrome/common/chrome_constants_win_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/chrome_constants.h"
+
+#include <memory>
+
+#include "base/file_version_info.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "base/strings/utf_string_conversions.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chrome {
+
+// Verify that |kChromeVersion| is equal to the version in the VS_VERSION_INFO
+// resource of chrome.exe.
+TEST(ChromeConstants, ChromeVersion) {
+ base::FilePath current_exe_dir;
+ EXPECT_TRUE(base::PathService::Get(base::DIR_EXE, &current_exe_dir));
+ base::FilePath chrome_exe_path =
+ current_exe_dir.Append(chrome::kBrowserProcessExecutableName);
+
+ std::unique_ptr<FileVersionInfo> file_version_info(
+ FileVersionInfo::CreateFileVersionInfo(chrome_exe_path));
+ ASSERT_TRUE(file_version_info);
+ EXPECT_EQ(base::UTF16ToASCII(file_version_info->file_version()),
+ kChromeVersion);
+}
+
+} // namespace chrome
« no previous file with comments | « chrome/app/main_dll_loader_win.cc ('k') | chrome/installer/util/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698