mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Speed up cursor blink test
This commit is contained in:
committed by
Antonio Scandurra
parent
7da588c3ee
commit
acf996fc14
@@ -256,9 +256,11 @@ describe('TextEditorComponent', () => {
|
||||
|
||||
it('blinks cursors when the editor is focused and the cursors are not moving', async () => {
|
||||
assertDocumentFocused()
|
||||
|
||||
const {component, element, editor} = buildComponent()
|
||||
component.props.cursorBlinkPeriod = 40
|
||||
component.props.cursorBlinkResumeDelay = 40
|
||||
editor.addCursorAtScreenPosition([1, 0])
|
||||
|
||||
element.focus()
|
||||
await component.getNextUpdatePromise()
|
||||
const [cursor1, cursor2] = element.querySelectorAll('.cursor')
|
||||
|
||||
@@ -1430,7 +1430,7 @@ class TextEditorComponent {
|
||||
this.cursorsBlinkedOff = true
|
||||
this.startCursorBlinking()
|
||||
this.resumeCursorBlinkingTimeoutHandle = null
|
||||
}, CURSOR_BLINK_RESUME_DELAY)
|
||||
}, (this.props.cursorBlinkResumeDelay || CURSOR_BLINK_RESUME_DELAY))
|
||||
}
|
||||
|
||||
stopCursorBlinking () {
|
||||
@@ -1448,7 +1448,7 @@ class TextEditorComponent {
|
||||
this.cursorBlinkIntervalHandle = window.setInterval(() => {
|
||||
this.cursorsBlinkedOff = !this.cursorsBlinkedOff
|
||||
this.scheduleUpdate(true)
|
||||
}, CURSOR_BLINK_PERIOD / 2)
|
||||
}, (this.props.cursorBlinkPeriod || CURSOR_BLINK_PERIOD) / 2)
|
||||
this.cursorsBlinking = true
|
||||
this.scheduleUpdate(true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user