blob: 297a97f46a45bfeea1685d24b56afac429d811fb [file] [log] [blame]
Roger Tawac0a1b9c2021-09-23 23:34:041// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "components/winhttp/net_util.h"
6#include "testing/gtest/include/gtest/gtest.h"
7
8namespace winhttp {
9
10TEST(WinHttpUtil, HRESULTFromLastError) {
11 ::SetLastError(ERROR_ACCESS_DENIED);
12 EXPECT_EQ(E_ACCESSDENIED, HRESULTFromLastError());
13 ::SetLastError(ERROR_SUCCESS);
14 EXPECT_EQ(E_FAIL, HRESULTFromLastError());
15}
16
17} // namespace winhttp