Chromium Code Reviews| 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..12cb9c7955d996993a14c7c765680606630a4205 |
| --- /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 the current module. |
|
grt (UTC plus 2)
2017/02/01 12:36:32
nit: update comment
fdoray
2017/02/01 18:29:16
Done.
|
| +TEST(ChromeConstants, ChromeVersion) { |
| + base::FilePath current_exe_dir; |
| + EXPECT_TRUE(base::PathService::Get(base::DIR_EXE, ¤t_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 |