Chromium Code Reviews| Index: chrome/browser/ssl/ssl_blocking_page_unittest.cc |
| diff --git a/chrome/browser/ssl/ssl_blocking_page_unittest.cc b/chrome/browser/ssl/ssl_blocking_page_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1ecbc4198c4c6455ed7c226e4846876c8216a0f1 |
| --- /dev/null |
| +++ b/chrome/browser/ssl/ssl_blocking_page_unittest.cc |
| @@ -0,0 +1,29 @@ |
| +// Copyright (c) 2012 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/browser/ssl/ssl_blocking_page.h" |
| +#include "chrome/test/base/browser_with_test_window_test.h" |
| +#include "content/public/browser/web_contents.h" |
| +#include "content/public/test/web_contents_tester.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +#if defined(OS_WIN) |
| +#include "base/win/windows_version.h" |
| +#endif |
| + |
| +TEST(SSLBlockingPageTest, SSLBlockingPageWindowsVersionTest) { |
|
felt
2014/06/30 18:36:15
This test won't get coverage because we don't have
radhikabhar
2014/07/01 23:56:49
Should I change it to get the OS info from OSInfo.
|
| + bool os_version_win = false; |
| +#if defined(OS_WIN) |
| + os_version_win = true; |
| + OSVERSIONINFOEX version_info = { sizeof version_info }; |
| + GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&version_info)); |
| + if ((version_info.dwMajorVersion == 5) && (version_info.dwMinorVersion == 1) |
| + && (version_info.wServicePackMajor < 3)) |
| + EXPECT_TRUE(SSLBlockingPage::WindowsVersionSP3Lower()); |
| + else |
| + EXPECT_FALSE(SSLBlockingPage::WindowsVersionSP3Lower()); |
| +#endif |
| + if (!os_version_win) |
| + EXPECT_FALSE(SSLBlockingPage::WindowsVersionSP3Lower()); |
| +} |