This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit 7a48e11
Add HttpListenerPrefixCollection tests and align managed implementation with Windows (#19217)
* Clean up some HttpListener code to make way for prefix code sharing
* Share HttpListenerPrefixCollection between managed and Windows implementations
* Align managed and Windows implementation of adding and removing prefixes
Move to a platform abstraction layer situation
* Add tests for HttpListenerPrefixCollection and things related to prefixes and HttpListener
* Fix some managed implementation test failures
Expects HttpListenerException thrown, actually SocketException was
thrown.
Fixes Add_InvalidPrefixNotStarted_ThrowsHttpListenerExceptionOnStart
Fixes Add_InvalidPrefixAlreadyStarted_ThrowsHttpListenerExceptionOnAdd
* Fix no exception thrown listening to an already registered host/port in managed
Fixes Add_PrefixAlreadyRegisteredAndStarted_ThrowsHttpListenerException
* Temporarily disable potentially bad tests
Should these be removed in PR feedback?
* Add explicit NRE throwing in HttpListenerPrefixCollection.CopyTo
* Fix NRE in HttpListenerPrefixCollection.CopyTo(null, 0)
* Improve managed implementation validation of hosts
And add a bunch of other tests for prefixes
* Address PR feedback1 parent e411611 commit 7a48e11
File tree
11 files changed
+738
-485
lines changed- src/System.Net.HttpListener
- src
- System/Net
- Managed
- Windows
- tests
11 files changed
+738
-485
lines changedLines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
| |||
Lines changed: 163 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 50 | + | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
| |||
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 60 | + | |
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
| |||
78 | 72 | | |
79 | 73 | | |
80 | 74 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 75 | + | |
85 | 76 | | |
86 | 77 | | |
87 | 78 | | |
| |||
91 | 82 | | |
92 | 83 | | |
93 | 84 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 85 | + | |
98 | 86 | | |
99 | 87 | | |
100 | 88 | | |
| |||
111 | 99 | | |
112 | 100 | | |
113 | 101 | | |
114 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
115 | 105 | | |
116 | 106 | | |
117 | 107 | | |
118 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
119 | 112 | | |
120 | 113 | | |
121 | 114 | | |
122 | | - | |
| 115 | + | |
123 | 116 | | |
124 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
125 | 201 | | |
126 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
127 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
128 | 267 | | |
129 | 268 | | |
130 | 269 | | |
| |||
136 | 275 | | |
137 | 276 | | |
138 | 277 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 278 | + | |
143 | 279 | | |
144 | 280 | | |
145 | 281 | | |
| |||
189 | 325 | | |
190 | 326 | | |
191 | 327 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 328 | + | |
196 | 329 | | |
197 | 330 | | |
0 commit comments