This source file includes following definitions.
- TEST
- TEST
- TEST
#include <windows.h>
#include "base/basictypes.h"
#include "base/strings/string_util.h"
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace win {
namespace {
class ThreadLocaleSaver {
public:
ThreadLocaleSaver() : original_locale_id_(GetThreadLocale()) {}
~ThreadLocaleSaver() { SetThreadLocale(original_locale_id_); }
private:
LCID original_locale_id_;
DISALLOW_COPY_AND_ASSIGN(ThreadLocaleSaver);
};
}
TEST(BaseWinUtilTest, TestIsUACEnabled) {
if (GetVersion() >= base::win::VERSION_VISTA) {
UserAccountControlIsEnabled();
} else {
EXPECT_TRUE(UserAccountControlIsEnabled());
}
}
TEST(BaseWinUtilTest, TestGetUserSidString) {
std::wstring user_sid;
EXPECT_TRUE(GetUserSidString(&user_sid));
EXPECT_TRUE(!user_sid.empty());
}
TEST(BaseWinUtilTest, TestGetNonClientMetrics) {
NONCLIENTMETRICS metrics = {0};
GetNonClientMetrics(&metrics);
EXPECT_TRUE(metrics.cbSize > 0);
EXPECT_TRUE(metrics.iScrollWidth > 0);
EXPECT_TRUE(metrics.iScrollHeight > 0);
}
}
}