using isCursorInitialized for domrenderer#4798
Conversation
|
Testing failed in Linux... 😒 |
|
It would be initialized because for each test This does not reset the cursor initialization state: xterm.js/src/browser/Terminal.ts Lines 1231 to 1251 in 32c6165 Since creating a new terminal can complicate the test side effects, we could solve this by making a new inject function: export function injectSharedRendererTestsStandalone(ctx: ISharedRendererTestContext): void {
...
}These can then re-create the terminal before each test which is probably just a matter of calling dispose terminal and then test('render when visible after hidden', async () => {
await openTerminal(ctx);
await ctx.page.evaluate(`
if ('term' in window) {
try {
window.term.dispose();
} catch {}
}
`);
await ctx.page.evaluate(`document.querySelector('#terminal-container').style.display='none'`);
await ctx.page.evaluate(`window.term = new Terminal()`);
await ctx.page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
await ctx.page.evaluate(`document.querySelector('#terminal-container').style.display=''`);
await pollFor(ctx.page, `window.term._core._renderService.dimensions.css.cell.width > 0`, true);
}); |
|
I see, adjust it. |
|
I still need to modify. This way of opening the page is inefficient. |
Tyriar
left a comment
There was a problem hiding this comment.
LGTM provided it changes after my changes to also run these in canvas/webgl 👍
fix #4790