forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WASM: Fix System.Net.Primitives and tests (dotnet#39748)
Add HostInformationPal and InterfaceInfoPal implementations for Browser. In CookiePortTest.cs use example.com instead of localhost for the tests since Browser uses `localhost` as the `Environment.MachineName` and that changes the test values. Allows the tests to run on WebAssembly: ``` System.Net.Primitives.Pal.Tests: Tests run: 60, Errors: 0, Failures: 0, Skipped: 0. Time: 0.15872s System.Net.Primitives.Functional.Tests: Tests run: 2620, Errors: 0, Failures: 0, Skipped: 1. Time: 3.145804s ```
- Loading branch information
1 parent
30e6b79
commit 7de187a
Showing
7 changed files
with
79 additions
and
33 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/libraries/Common/src/System/Net/NetworkInformation/HostInformationPal.Browser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Net.NetworkInformation | ||
{ | ||
internal static class HostInformationPal | ||
{ | ||
public static string GetHostName() | ||
{ | ||
return Environment.MachineName; | ||
} | ||
|
||
public static string GetDomainName() | ||
{ | ||
return Environment.UserDomainName; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/System/Net/NetworkInformation/InterfaceInfoPal.Browser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Net.NetworkInformation | ||
{ | ||
internal static class InterfaceInfoPal | ||
{ | ||
public static uint InterfaceNameToIndex(string interfaceName) | ||
{ | ||
// zero means "unknown" | ||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters