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) { |
+ 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()); |
+} |