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

Unified Diff: base/test/test_shortcut_win.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Various nits Created 3 years, 7 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/path_service_unittest.cc ('k') | base/win/shortcut.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_shortcut_win.cc
diff --git a/base/test/test_shortcut_win.cc b/base/test/test_shortcut_win.cc
index 25dc372d24e09f57a99e50079a6d5a47f14491eb..196cee91986ab9be2652cdab770ec9e1a5ac271e 100644
--- a/base/test/test_shortcut_win.cc
+++ b/base/test/test_shortcut_win.cc
@@ -14,7 +14,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_propvariant.h"
-#include "base/win/windows_version.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -113,44 +112,42 @@ void ValidateShortcut(const base::FilePath& shortcut_path,
EXPECT_EQ(properties.icon_index, read_icon_index);
}
- if (GetVersion() >= VERSION_WIN7) {
- ScopedComPtr<IPropertyStore> property_store;
- EXPECT_TRUE(
- SUCCEEDED(hr = i_shell_link.CopyTo(property_store.GetAddressOf())));
- if (FAILED(hr))
- return;
-
- if (properties.options & ShortcutProperties::PROPERTIES_APP_ID) {
- ScopedPropVariant pv_app_id;
- EXPECT_EQ(S_OK, property_store->GetValue(PKEY_AppUserModel_ID,
- pv_app_id.Receive()));
- switch (pv_app_id.get().vt) {
- case VT_EMPTY:
- EXPECT_TRUE(properties.app_id.empty());
- break;
- case VT_LPWSTR:
- EXPECT_EQ(properties.app_id, pv_app_id.get().pwszVal);
- break;
- default:
- ADD_FAILURE() << "Unexpected variant type: " << pv_app_id.get().vt;
- }
+ ScopedComPtr<IPropertyStore> property_store;
+ EXPECT_TRUE(
+ SUCCEEDED(hr = i_shell_link.CopyTo(property_store.GetAddressOf())));
+ if (FAILED(hr))
+ return;
+
+ if (properties.options & ShortcutProperties::PROPERTIES_APP_ID) {
+ ScopedPropVariant pv_app_id;
+ EXPECT_EQ(S_OK, property_store->GetValue(PKEY_AppUserModel_ID,
+ pv_app_id.Receive()));
+ switch (pv_app_id.get().vt) {
+ case VT_EMPTY:
+ EXPECT_TRUE(properties.app_id.empty());
+ break;
+ case VT_LPWSTR:
+ EXPECT_EQ(properties.app_id, pv_app_id.get().pwszVal);
+ break;
+ default:
+ ADD_FAILURE() << "Unexpected variant type: " << pv_app_id.get().vt;
}
+ }
- if (properties.options & ShortcutProperties::PROPERTIES_DUAL_MODE) {
- ScopedPropVariant pv_dual_mode;
- EXPECT_EQ(S_OK, property_store->GetValue(PKEY_AppUserModel_IsDualMode,
- pv_dual_mode.Receive()));
- switch (pv_dual_mode.get().vt) {
- case VT_EMPTY:
- EXPECT_FALSE(properties.dual_mode);
- break;
- case VT_BOOL:
- EXPECT_EQ(properties.dual_mode,
- static_cast<bool>(pv_dual_mode.get().boolVal));
- break;
- default:
- ADD_FAILURE() << "Unexpected variant type: " << pv_dual_mode.get().vt;
- }
+ if (properties.options & ShortcutProperties::PROPERTIES_DUAL_MODE) {
+ ScopedPropVariant pv_dual_mode;
+ EXPECT_EQ(S_OK, property_store->GetValue(PKEY_AppUserModel_IsDualMode,
+ pv_dual_mode.Receive()));
+ switch (pv_dual_mode.get().vt) {
+ case VT_EMPTY:
+ EXPECT_FALSE(properties.dual_mode);
+ break;
+ case VT_BOOL:
+ EXPECT_EQ(properties.dual_mode,
+ static_cast<bool>(pv_dual_mode.get().boolVal));
+ break;
+ default:
+ ADD_FAILURE() << "Unexpected variant type: " << pv_dual_mode.get().vt;
}
}
}
« no previous file with comments | « base/path_service_unittest.cc ('k') | base/win/shortcut.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698