code: def test_plot_raw_child_figures(raw, browser_backend):
      """Test spawning and closing of child figures."""
      ismpl = browser_backend.name == "matplotlib"
      with raw.info._unlock():
          raw.info[
              "lowpass"
          ] = 10.0  # allow heavy decim during plotting
      # make sure we start clean
      assert browser_backend._get_n_figs() == 0
      fig = raw.plot()
      assert browser_backend._get_n_figs() == 1
      # test child fig toggles
      _child_fig_helper(fig, "?", "fig_help", browser_backend)
      _child_fig_helper(fig, "j", "fig_proj", browser_backend)
      if (
          ismpl
      ):  # in mne-qt-browser, annotation is a dock-widget, not a window
          _child_fig_helper(fig, "a", "fig_annotation", browser_backend)
      # test right-click → channel location popup
      fig._redraw()
      fig._click_ch_name(ch_index=2, button=3)
      assert len(fig.mne.child_figs) == 1
      assert browser_backend._get_n_figs() == 2
      fig._fake_keypress("escape", fig=fig.mne.child_figs[0])
      if ismpl:
          fig._close_event(fig.mne.child_figs[0])
      assert len(fig.mne.child_figs) == 0
      assert browser_backend._get_n_figs() == 1
      # test right-click on non-data channel
      ix = raw.get_channel_types().index(
          "ias"
      )  # find the shielding channel
      trace_ix = fig.mne.ch_order.tolist().index(
          ix
      )  # get its plotting position
      fig._redraw()
      fig._click_ch_name(ch_index=trace_ix, button=3)  # should be no-op
      assert len(fig.mne.child_figs) == 0
      assert browser_backend._get_n_figs() == 1
      # test resize of main window
      fig._resize_by_factor(0.5)
  
imports: import itertools
  import os
  from copy import deepcopy
  import matplotlib.pyplot
  import numpy
  import pytest
  from matplotlib import backend_bases
  from numpy.testing import assert_allclose
  from mne import Annotations, create_info, pick_types
  from mne._fiff.pick import _DATA_CH_TYPES_ORDER_DEFAULT, _PICK_TYPES_DATA_DICT
  from mne.annotations import _sync_onset
  from mne.datasets import testing
  from mne.io import RawArray
  from mne.utils import _assert_no_instances, _dt_to_stamp, _record_warnings, check_version, get_config, set_config
  from mne.viz import plot_raw, plot_sensors
  from mne.viz.utils import _fake_click, _fake_keypress
label_desc: Use image node_id 13 for calling a global function with example usage: test_plot_raw_child_figures(raw, browser_backend) without return types