createRoundTripTestCallback = (testCase) => {
    return function () {
      if (testCase.json) {
        const block = blockly.serialization.blocks.append(
          testCase.json,
          this.workspace,
          {recordUndo: true},
        );
        if (globalThis.clock) globalThis.clock.runAll();
        const generatedJson = blockly.serialization.blocks.save(block);
        const expectedJson = testCase.expectedJson || testCase.json;
        assert.deepEqual(generatedJson, expectedJson);
      } else {
        const block = blockly.Xml.domToBlock(
          blockly.utils.xml.textToDom(testCase.xml),
          this.workspace,
        );
        if (globalThis.clock) globalThis.clock.runAll();
        const generatedXml = blockly.Xml.domToPrettyText(
          blockly.Xml.blockToDom(block),
        );
        const expectedXml = testCase.expectedXml || testCase.xml;
        assert.equal(generatedXml, expectedXml);
      }
    };
  }
Creates test callback for xml round trip test.
@param {!SerializationTestCase} testCase The test case information.
@returns {!Function} The test callback.