net_util_unittest.cc 515 B

1234567891011121314151617
  1. // 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. #include "components/winhttp/net_util.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. namespace winhttp {
  7. TEST(WinHttpUtil, HRESULTFromLastError) {
  8. ::SetLastError(ERROR_ACCESS_DENIED);
  9. EXPECT_EQ(E_ACCESSDENIED, HRESULTFromLastError());
  10. ::SetLastError(ERROR_SUCCESS);
  11. EXPECT_EQ(E_FAIL, HRESULTFromLastError());
  12. }
  13. } // namespace winhttp