summaryrefslogtreecommitdiff
path: root/chromium/components/winhttp/net_util_unittest.cc
blob: e0e3e06fd31c9004689a77aaa40e7e8a08136c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/winhttp/net_util.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace winhttp {

TEST(WinHttpUtil, HRESULTFromLastError) {
  ::SetLastError(ERROR_ACCESS_DENIED);
  EXPECT_EQ(E_ACCESSDENIED, HRESULTFromLastError());
  ::SetLastError(ERROR_SUCCESS);
  EXPECT_EQ(E_FAIL, HRESULTFromLastError());
}

}  // namespace winhttp