Nacre/vendor/servo-net/tests/decoder.rs
astar76 a915040a0a S006: YouTube loads (HTTP/2 header limit), basics smoke, Escape leaves page full screen
servo-net 0.7.0 keeps hyper's 16 KiB HTTP/2 header list limit; YouTube sends
~19 KiB, so the stream was reset and Servo showed SendRequest. vendor/servo-net
raises it to 256 KiB (D-012).
Escape went to the page only in full screen (inverted check): keys::page_gets_key.
tests/smoke/basics.txt: tabs, navigation, address bar, find, zoom, full screen,
_blank, pop-up, new window. Selftest expect/locate, pagetype {escape}.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 08:20:51 -06:00

41 lines
1.4 KiB
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::io;
use net::test::{BodyStreamError, map_decode_error};
#[test]
fn test_map_decode_error_wraps_decoder_errors_as_invalid_data() {
for err in [
io::Error::other("Unknown frame"),
io::Error::new(io::ErrorKind::UnexpectedEof, "zstd stream did not finish"),
] {
assert_eq!(
map_decode_error(err).kind(),
io::ErrorKind::InvalidData,
"decoder errors should be normalized to InvalidData"
);
}
}
#[test]
fn test_map_decode_error_passes_network_errors_through() {
let network_error = io::Error::other(BodyStreamError("connection reset".into()));
let mapped = map_decode_error(network_error);
assert_eq!(mapped.kind(), io::ErrorKind::Other);
assert!(
mapped
.get_ref()
.is_some_and(|inner| inner.is::<BodyStreamError>())
);
}
#[test]
fn test_map_decode_error_passes_nested_network_errors_through() {
let network_error = io::Error::other(BodyStreamError("connection reset".into()));
let wrapped = io::Error::new(io::ErrorKind::BrokenPipe, network_error);
let mapped = map_decode_error(wrapped);
assert_eq!(mapped.kind(), io::ErrorKind::BrokenPipe);
}