# Subsystem: tests (page 1 of 8)
Pages: [KB_tests.md](KB_tests.md), [KB_tests_p2.md](KB_tests_p2.md), [KB_tests_p3.md](KB_tests_p3.md), [KB_tests_p4.md](KB_tests_p4.md), [KB_tests_p5.md](KB_tests_p5.md), [KB_tests_p6.md](KB_tests_p6.md), [KB_tests_p7.md](KB_tests_p7.md), [KB_tests_p8.md](KB_tests_p8.md)

## tests/itest_secure_fetch.c
- Layer: testing
- Language: c
- Symbols:
  - `main` (function, line 26) `int main(void)`
  - `CHECK` (macro, line 16) `#define CHECK(cond, msg)`
- Depends on: `include/secure_fetch.h`

## tests/test_anti_fp.c
- Doc: test_origin_key_unlinks_readback: The property that actually matters: the same canvas buffer...
- Layer: testing
- Language: c
- Symbols:
  - `test_coarsen_time` (function, line 18) `static void test_coarsen_time(void **state)`
  - `test_identity_is_fixed` (function, line 34) `static void test_identity_is_fixed(void **state)`
  - `test_legacy_identity_fixed` (function, line 61) `static void test_legacy_identity_fixed(void **state)`
  - `test_boolean_props` (function, line 74) `static void test_boolean_props(void **state)`
  - `test_bucket_screen` (function, line 83) `static void test_bucket_screen(void **state)`
  - `test_perturb_deterministic` (function, line 101) `static void test_perturb_deterministic(void **state)`
  - `test_perturb_bounded_lsb` (function, line 111) `static void test_perturb_bounded_lsb(void **state)`
  - `test_perturb_key_sensitive` (function, line 126) `static void test_perturb_key_sensitive(void **state)`
  - `test_perturb_safe_edges` (function, line 136) `static void test_perturb_safe_edges(void **state)`
  - `test_origin_key_deterministic` (function, line 146) `static void test_origin_key_deterministic(void **state)`
  - `test_origin_key_per_site` (function, line 153) `static void test_origin_key_per_site(void **state)`
  - `test_origin_key_per_session` (function, line 165) `static void test_origin_key_per_session(void **state)`
  - `test_origin_key_empty_namespace` (function, line 171) `static void test_origin_key_empty_namespace(void **state)`
  - `test_origin_key_unlinks_readback` (function, line 183) `static void test_origin_key_unlinks_readback(void **state)`
  - `main` (function, line 197) `int main(void)`
- Depends on: `include/anti_fp.h`

## tests/test_block_flow.c
- Doc: test_two_positive_collapse_to_max: Two positive margins collapse to the LARGER, never to their...
- Layer: testing
- Language: c
- Symbols:
  - `dbl_eq` (function, line 21) `static int dbl_eq(double a, double b)`
  - `test_two_positive_collapse_to_max` (function, line 29) `static void test_two_positive_collapse_to_max(void **state)`
  - `test_two_negative_take_the_most_negative` (function, line 50) `static void test_two_negative_take_the_most_negative(void **state)`
  - `test_non_finite_is_absent` (function, line 59) `static void test_non_finite_is_absent(void **state)`
  - `test_collapse_n_matches_binary` (function, line 70) `static void test_collapse_n_matches_binary(void **state)`
  - `test_collapse_n_edges` (function, line 84) `static void test_collapse_n_edges(void **state)`
  - `test_margins_adjoin` (function, line 95) `static void test_margins_adjoin(void **state)`
  - `main` (function, line 105) `int main(void)`
- Depends on: `include/block_flow.h`

## tests/test_box_blur.c
- Layer: testing
- Language: c
- Symbols:
  - `mass` (function, line 11) `static long mass(const unsigned char *b, int n)`
  - `test_box_sizes` (function, line 17) `static void test_box_sizes(void **state)`
  - `test_impulse_conserves_mass_and_is_symmetric` (function, line 34) `static void test_impulse_conserves_mass_and_is_symmetric(void **state)`
  - `test_zero_sigma_is_identity` (function, line 50) `static void test_zero_sigma_is_identity(void **state)`
  - `test_uniform_interior_unchanged` (function, line 58) `static void test_uniform_interior_unchanged(void **state)`
  - `test_invalid_arguments` (function, line 69) `static void test_invalid_arguments(void **state)`
  - `put_px` (function, line 80) `static void put_px(unsigned char *d, int stride, int x, int y, unsigned char a)`
  - `test_ink_rect_empty_surface_has_no_ink` (function, line 85) `static void test_ink_rect_empty_surface_has_no_ink(void **state)`
  - `test_ink_rect_grows_by_the_blur_reach_and_clamps` (function, line 93) `static void test_ink_rect_grows_by_the_blur_reach_and_clamps(void **state)`
  - `test_ink_rect_covers_every_pixel_the_blur_can_touch` (function, line 112) `static void test_ink_rect_covers_every_pixel_the_blur_can_touch(void **state)`
  - `main` (function, line 130) `int main(void)`
- Depends on: `include/box_blur.h`

## tests/test_box_style.c
- Doc: dbl_eq: #include <setjmp.h> #include <stdarg.h> #include <stddef.h> #include <stdint.h> #include...
- Layer: testing
- Language: c
- Symbols:
  - `dbl_eq` (function, line 23) `static int dbl_eq(double a, double b)`
  - `assert_edges` (function, line 28) `static void assert_edges(bx_edges e, double t, double r, double b, double l)`
  - `test_body_has_no_margin` (function, line 35) `static void test_body_has_no_margin(void **state)`
  - `test_paragraph` (function, line 43) `static void test_paragraph(void **state)`
  - `test_heading_ladder` (function, line 50) `static void test_heading_ladder(void **state)`
  - `test_lists` (function, line 66) `static void test_lists(void **state)`
  - `test_blockquote` (function, line 77) `static void test_blockquote(void **state)`
  - `test_hr` (function, line 84) `static void test_hr(void **state)`
  - `test_inline_and_inline_block` (function, line 91) `static void test_inline_and_inline_block(void **state)`
  - `test_display_none_for_non_rendered` (function, line 102) `static void test_display_none_for_non_rendered(void **state)`
  - `test_case_insensitive` (function, line 111) `static void test_case_insensitive(void **state)`
  - `test_unknown_and_null_are_neutral_inline` (function, line 119) `static void test_unknown_and_null_are_neutral_inline(void **state)`
  - `test_div_is_block` (function, line 134) `static void test_div_is_block(void **state)`
  - `test_ua_structural_wrappers_have_no_margin` (function, line 145) `static void test_ua_structural_wrappers_have_no_margin(void **state)`
  - `test_ua_spaced_tags_round_trip` (function, line 162) `static void test_ua_spaced_tags_round_trip(void **state)`
  - `test_ua_list_item_is_distinct_but_unspaced` (function, line 182) `static void test_ua_list_item_is_distinct_but_unspaced(void **state)`
  - `test_block_ua_box_is_content_independent` (function, line 195) `static void test_block_ua_box_is_content_independent(void **state)`
  - `test_block_ua_box_heading_level_wins` (function, line 206) `static void test_block_ua_box_heading_level_wins(void **state)`
  - `test_block_ua_box_list_item_wins_over_ancestor` (function, line 219) `static void test_block_ua_box_list_item_wins_over_ancestor(void **state)`
  - `test_block_ua_box_is_total` (function, line 228) `static void test_block_ua_box_is_total(void **state)`
  - `test_table_role_from_tag` (function, line 243) `static void test_table_role_from_tag(void **state)`
  - `test_table_role_is_total` (function, line 273) `static void test_table_role_is_total(void **state)`
  - `test_ua_case_insensitive_and_trimmed` (function, line 283) `static void test_ua_case_insensitive_and_trimmed(void **state)`
  - `test_ua_fails_closed` (function, line 291) `static void test_ua_fails_closed(void **state)`
  - `test_ua_code_space_is_total` (function, line 309) `static void test_ua_code_space_is_total(void **state)`
  - `test_parse_display_keywords` (function, line 320) `static void test_parse_display_keywords(void **state)`
  - `test_parse_display_inline_aliases` (function, line 339) `static void test_parse_display_inline_aliases(void **state)`
  - `test_parse_display_case_and_trim` (function, line 348) `static void test_parse_display_case_and_trim(void **state)`
  - `test_parse_display_errors` (function, line 357) `static void test_parse_display_errors(void **state)`
  - `test_display_name` (function, line 375) `static void test_display_name(void **state)`
  - `test_place_no_box_is_identity` (function, line 390) `static void test_place_no_box_is_identity(void **state)`
  - `test_place_max_width_caps` (function, line 397) `static void test_place_max_width_caps(void **state)`
  - `test_place_centering` (function, line 408) `static void test_place_centering(void **state)`
  - `test_place_insets` (function, line 420) `static void test_place_insets(void **state)`
  - `test_place_failclosed_bounds` (function, line 432) `static void test_place_failclosed_bounds(void **state)`
  - `test_border_box_height` (function, line 475) `static void test_border_box_height(void **state)`
  - `test_content_clipped` (function, line 493) `static void test_content_clipped(void **state)`
  - `test_width_cap_pct` (function, line 509) `static void test_width_cap_pct(void **state)`
  - `test_width_cap2_is_min_of_two_values` (function, line 524) `static void test_width_cap2_is_min_of_two_values(void **state)`
  - `percentage` (function, line 543) `* percentage (a plain `width:50%` leaves the px half UNSET, a plain `width:300px`
 * leaves the p...`
  - `test_flex_max_clamp` (function, line 611) `static void test_flex_max_clamp(void **state)`
  - `test_place_declared_width_overflows` (function, line 627) `static void test_place_declared_width_overflows(void **state)`
  - `test_border_span` (function, line 646) `static void test_border_span(void **state)`
  - `test_flex_min_clamp` (function, line 659) `static void test_flex_min_clamp(void **state)`
  - `test_pct_block_size` (function, line 672) `static void test_pct_block_size(void **state)`
  - `test_definite_content_h` (function, line 688) `static void test_definite_content_h(void **state)`
  - `test_line_height_px` (function, line 701) `static void test_line_height_px(void **state)`
  - `main` (function, line 712) `int main(void)`
  - `width` (function, line 553) `* a negative width (CSS Values 4 section 10.1: out-of-range calc() results are * clamped at used-value time). */...`
- Depends on: `include/box_style.h`

## tests/test_box_tree.c
- Doc: test_flex_auto_margin_pushes_item: Flexbox 8.1: an item's auto margin takes the free space...
- Layer: testing
- Language: c
- Symbols:
  - `assert_rect` (function, line 28) `static void assert_rect(const bt_node *n, double x, double y, double w, double h)`
  - `test_null_root` (function, line 35) `static void test_null_root(void **state)`
  - `test_leaf` (function, line 40) `static void test_leaf(void **state)`
  - `test_leaf_with_padding` (function, line 47) `static void test_leaf_with_padding(void **state)`
  - `test_block_stacking_with_collapse` (function, line 62) `static void test_block_stacking_with_collapse(void **state)`
  - `test_flex_row_grow` (function, line 75) `static void test_flex_row_grow(void **state)`
  - `test_flex_auto_margin_pushes_item` (function, line 95) `static void test_flex_auto_margin_pushes_item(void **state)`
  - `test_flex_gap_and_justify_center` (function, line 113) `static void test_flex_gap_and_justify_center(void **state)`
  - `test_flex_wrap_two_lines` (function, line 129) `static void test_flex_wrap_two_lines(void **state)`
  - `test_flex_nowrap_default_single_line_unchanged` (function, line 151) `static void test_flex_nowrap_default_single_line_unchanged(void **state)`
  - `test_flex_wrap_reverse_two_lines` (function, line 171) `static void test_flex_wrap_reverse_two_lines(void **state)`
  - `test_flex_wrap_row_gap_distinct_from_gap` (function, line 193) `static void test_flex_wrap_row_gap_distinct_from_gap(void **state)`
  - `test_flex_cross_axis_align` (function, line 213) `static void test_flex_cross_axis_align(void **state)`
  - `test_grid_row_gap_distinct_from_gap` (function, line 231) `static void test_grid_row_gap_distinct_from_gap(void **state)`
  - `test_grid_without_row_gap_falls_back_to_gap` (function, line 254) `static void test_grid_without_row_gap_falls_back_to_gap(void **state)`
  - `test_grid` (function, line 270) `static void test_grid(void **state)`
  - `test_grid_weighted_tracks` (function, line 291) `static void test_grid_weighted_tracks(void **state)`
  - `test_grid_column_span` (function, line 309) `static void test_grid_column_span(void **state)`
  - `test_nested_flex_in_block` (function, line 329) `static void test_nested_flex_in_block(void **state)`
  - `test_display_none_skipped` (function, line 353) `static void test_display_none_skipped(void **state)`
  - `test_grid_bad_columns` (function, line 368) `static void test_grid_bad_columns(void **state)`
  - `test_flex_negative_gap` (function, line 378) `static void test_flex_negative_gap(void **state)`
  - `test_children_cap` (function, line 388) `static void test_children_cap(void **state)`
  - `test_depth_cap` (function, line 398) `static void test_depth_cap(void **state)`
  - `test_positioning_null_args` (function, line 415) `static void test_positioning_null_args(void **state)`
  - `test_positioning_static_unchanged` (function, line 429) `static void test_positioning_static_unchanged(void **state)`
  - `test_positioning_relative_offset` (function, line 441) `static void test_positioning_relative_offset(void **state)`
  - `test_positioning_absolute_against_ancestor` (function, line 462) `static void test_positioning_absolute_against_ancestor(void **state)`
  - `test_positioning_absolute_against_viewport` (function, line 485) `static void test_positioning_absolute_against_viewport(void **state)`
  - `test_positioning_fixed_against_viewport` (function, line 502) `static void test_positioning_fixed_against_viewport(void **state)`
  - `test_positioning_sticky_treated_as_relative` (function, line 521) `static void test_positioning_sticky_treated_as_relative(void **state)`
  - `test_positioning_stacking_order` (function, line 539) `static void test_positioning_stacking_order(void **state)`
  - `test_positioning_doc_order_tiebreak` (function, line 559) `static void test_positioning_doc_order_tiebreak(void **state)`
  - `test_positioning_no_insets` (function, line 577) `static void test_positioning_no_insets(void **state)`
  - `test_positioning_null_geometry` (function, line 594) `static void test_positioning_null_geometry(void **state)`
  - `test_positioning_nbox_cap` (function, line 611) `static void test_positioning_nbox_cap(void **state)`
  - `test_static_position_absolute_auto_insets` (function, line 633) `static void test_static_position_absolute_auto_insets(void **state)`
  - `test_static_position_fixed_auto_insets` (function, line 649) `static void test_static_position_fixed_auto_insets(void **state)`
  - `test_static_position_explicit_insets_win` (function, line 665) `static void test_static_position_explicit_insets_win(void **state)`
  - `test_static_position_mixed_axis` (function, line 686) `static void test_static_position_mixed_axis(void **state)`
  - `test_static_position_right_inset_keeps_anchor` (function, line 706) `static void test_static_position_right_inset_keeps_anchor(void **state)`
  - `test_static_position_null_arrays_legacy` (function, line 726) `static void test_static_position_null_arrays_legacy(void **state)`
  - `test_abspos_resolves_against_placed_ancestor` (function, line 744) `static void test_abspos_resolves_against_placed_ancestor(void **state)`
  - `test_abspos_unplaced_without_anchor_falls_to_viewport` (function, line 774) `static void test_abspos_unplaced_without_anchor_falls_to_viewport(void **state)`
  - `test_box_hidden_self` (function, line 794) `static void test_box_hidden_self(void **state)`
  - `test_box_hidden_ancestor` (function, line 806) `static void test_box_hidden_ancestor(void **state)`
  - `test_box_hidden_fail_closed` (function, line 819) `static void test_box_hidden_fail_closed(void **state)`
  - `test_oof_anchor_none_on_static_chain` (function, line 853) `static void test_oof_anchor_none_on_static_chain(void **state)`
  - `test_oof_anchor_self` (function, line 863) `static void test_oof_anchor_self(void **state)`
  - `test_oof_anchor_via_ancestor` (function, line 870) `static void test_oof_anchor_via_ancestor(void **state)`
  - `test_oof_nested_absolute_anchor_vs_root` (function, line 883) `static void test_oof_nested_absolute_anchor_vs_root(void **state)`
  - `test_oof_relative_does_not_anchor` (function, line 898) `static void test_oof_relative_does_not_anchor(void **state)`
  - `test_oof_fail_open` (function, line 912) `static void test_oof_fail_open(void **state)`
  - `test_oof_avail_stretch_and_shrink` (function, line 934) `static void test_oof_avail_stretch_and_shrink(void **state)`
  - `test_grid_row_tracks_definite_height` (function, line 955) `static void test_grid_row_tracks_definite_height(void **state)`
  - `test_grid_spanning_item_fits_tracked_rows` (function, line 994) `static void test_grid_spanning_item_fits_tracked_rows(void **state)`
  - `test_flex_single_line_definite_height` (function, line 1018) `static void test_flex_single_line_definite_height(void **state)`
  - `test_grid_justify_self` (function, line 1045) `static void test_grid_justify_self(void **state)`
  - `dbox` (function, line 1071) `static pv_box_def dbox(int parent, int position, int z)`
  - `test_defer_relative_after_abs` (function, line 1080) `static void test_defer_relative_after_abs(void **state)`
  - `test_defer_relative_before_abs_is_not_deferred` (function, line 1097) `static void test_defer_relative_before_abs_is_not_deferred(void **state)`
  - `test_defer_respects_z_order` (function, line 1109) `static void test_defer_respects_z_order(void **state)`
  - `test_defer_outermost_root_and_negative_z` (function, line 1124) `static void test_defer_outermost_root_and_negative_z(void **state)`
  - `test_defer_nested_higher_z_keeps_own_turn` (function, line 1148) `static void test_defer_nested_higher_z_keeps_own_turn(void **state)`
  - `test_defer_uses_tree_order_not_index` (function, line 1170) `static void test_defer_uses_tree_order_not_index(void **state)`
  - `test_defer_fails_open` (function, line 1186) `static void test_defer_fails_open(void **state)`
  - `main` (function, line 1200) `int main(void)`
  - `card` (function, line 769) `* containing block climbs the unplaced card(1) → placed ancestor(0, x=100). */ assert_true(dbl_eq(out[2].x, 100));`
  - `UNSET4` (macro, line 630) `#define UNSET4`
- Depends on: `include/box_tree.h`, `include/css.h`, `include/page_view.h`

## tests/test_browser.c
- Doc: test_url_bar_selection: Omnibar selection model: extend builds a selection, ops replace/delete...
- Layer: testing
- Language: c
- Symbols:
  - `test_init` (function, line 20) `static void test_init(void **state)`
  - `test_navigate_history` (function, line 31) `static void test_navigate_history(void **state)`
  - `test_navigate_from_middle_discards_future` (function, line 61) `static void test_navigate_from_middle_discards_future(void **state)`
  - `test_back_forward_bounds` (function, line 79) `static void test_back_forward_bounds(void **state)`
  - `test_rejects_invalid_url` (function, line 95) `static void test_rejects_invalid_url(void **state)`
  - `test_accepts_https_and_file` (function, line 108) `static void test_accepts_https_and_file(void **state)`
  - `test_url_bar_editing` (function, line 122) `static void test_url_bar_editing(void **state)`
  - `test_url_bar_selection` (function, line 152) `static void test_url_bar_selection(void **state)`
  - `test_set_page` (function, line 196) `static void test_set_page(void **state)`
  - `test_set_page_sanitizes_invalid_utf8` (function, line 218) `static void test_set_page_sanitizes_invalid_utf8(void **state)`
  - `test_exceptions` (function, line 252) `static void test_exceptions(void **state)`
  - `test_status_toast` (function, line 277) `static void test_status_toast(void **state)`
  - `test_status_truncates` (function, line 309) `static void test_status_truncates(void **state)`
  - `test_push_state_same_document` (function, line 328) `static void test_push_state_same_document(void **state)`
  - `test_push_state_rejects_and_guards` (function, line 361) `static void test_push_state_rejects_and_guards(void **state)`
  - `main` (function, line 378) `int main(void)`
  - `_POSIX_C_SOURCE` (macro, line 8) `#define _POSIX_C_SOURCE`
- Depends on: `include/browser.h`

## tests/test_cached_fetch.c
- Layer: testing
- Language: c
- Symbols:
  - `fake_fetch` (function, line 23) `static sf_status fake_fetch(const char *url, sf_config *cfg, sf_response *out, int *dg, int al)`
  - `setup` (function, line 44) `static int setup(void **state)`
  - `teardown` (function, line 53) `static int teardown(void **state)`
  - `get` (function, line 61) `static sf_status get(const char *part, const char *url, sf_config *cfg, sf_response *r, time_t now)`
  - `test_miss_fetches_stores_then_fresh_hit_skips_network` (function, line 66) `static void test_miss_fetches_stores_then_fresh_hit_skips_network(void **state)`
  - `test_stale_entry_revalidates_and_304_serves_cached_body` (function, line 82) `static void test_stale_entry_revalidates_and_304_serves_cached_body(void **state)`
  - `test_stale_entry_with_new_200_replaces_the_body` (function, line 101) `static void test_stale_entry_with_new_200_replaces_the_body(void **state)`
  - `test_partitions_isolated` (function, line 118) `static void test_partitions_isolated(void **state)`
  - `test_no_store_credentials_range_and_non_200_are_never_cached` (function, line 129) `static void test_no_store_credentials_range_and_non_200_are_never_cached(void **state)`
  - `test_non_https_url_bypasses_the_cache` (function, line 154) `static void test_non_https_url_bypasses_the_cache(void **state)`
  - `test_null_store_is_a_plain_fetch` (function, line 163) `static void test_null_store_is_a_plain_fetch(void **state)`
  - `main` (function, line 173) `int main(void)`
  - `_GNU_SOURCE` (macro, line 1) `#define _GNU_SOURCE`
  - `NOW` (macro, line 12) `#define NOW`
- Depends on: `include/cached_fetch.h`

## tests/test_compositor.c
- Doc: test_sort_matches_zindex_only_ordering: The positioned subset the painter already orders by...
- Layer: testing
- Language: c
- Symbols:
  - `test_sc_opacity` (function, line 26) `static void test_sc_opacity(void **state)`
  - `test_sc_mix_blend` (function, line 35) `static void test_sc_mix_blend(void **state)`
  - `test_sc_isolation` (function, line 43) `static void test_sc_isolation(void **state)`
  - `test_sc_transform` (function, line 51) `static void test_sc_transform(void **state)`
  - `test_sc_positioned_z` (function, line 58) `static void test_sc_positioned_z(void **state)`
  - `test_sc_fixed_sticky_always` (function, line 70) `static void test_sc_fixed_sticky_always(void **state)`
  - `test_sc_static_none` (function, line 77) `static void test_sc_static_none(void **state)`
  - `test_layer_negative_z` (function, line 86) `static void test_layer_negative_z(void **state)`
  - `test_layer_positive_z` (function, line 93) `static void test_layer_positive_z(void **state)`
  - `test_layer_zero_z_context` (function, line 100) `static void test_layer_zero_z_context(void **state)`
  - `test_layer_zero_z_positioned_auto` (function, line 109) `static void test_layer_zero_z_positioned_auto(void **state)`
  - `test_layer_float` (function, line 116) `static void test_layer_float(void **state)`
  - `test_layer_inline_and_block` (function, line 123) `static void test_layer_inline_and_block(void **state)`
  - `mk` (function, line 133) `static cx_item mk(cx_layer layer, int z, int z_auto, size_t doc, size_t ref)`
  - `test_compare_layer_then_z_then_doc` (function, line 139) `static void test_compare_layer_then_z_then_doc(void **state)`
  - `test_sort_full_paint_order` (function, line 160) `static void test_sort_full_paint_order(void **state)`
  - `test_sort_z_within_layer` (function, line 177) `static void test_sort_z_within_layer(void **state)`
  - `test_sort_stability` (function, line 193) `static void test_sort_stability(void **state)`
  - `test_sort_noop_guards` (function, line 207) `static void test_sort_noop_guards(void **state)`
  - `test_sort_matches_zindex_only_ordering` (function, line 218) `static void test_sort_matches_zindex_only_ordering(void **state)`
  - `main` (function, line 231) `int main(void)`
- Depends on: `include/compositor.h`, `include/css.h`


Next: [KB_tests_p2.md](KB_tests_p2.md)
