Fix errors in benchmarks

One notable change is that if the editor has a display update pending,
we wait until it completes before moving on to the next benchmark.
This commit is contained in:
Nathan Sobo 2013-02-06 18:01:32 -07:00
parent c69e217192
commit 5b3755a170
3 changed files with 11 additions and 4 deletions

View File

@ -10,7 +10,7 @@ require 'window'
requireStylesheet "jasmine.css"
# Load TextMate bundles, which specs rely on (but not other packages)
atom.loadPackages(atom.getAvailableTextMateBundles())
atom.loadTextMatePackages()
beforeEach ->
# reset config after each benchmark; don't load or save from/to `config.json`

View File

@ -17,9 +17,15 @@ describe "editor.", ->
editor = rootView.getActiveEditor()
afterEach ->
$(window).off 'beforeunload'
window.shutdown()
atom.setRootViewStateForPath(rootView.project.getPath(), null)
if editor.pendingDisplayUpdate
waitsFor "editor to finish rendering", (done) ->
editor.on 'editor:display-updated', done
runs ->
projectPath = rootView.project.getPath()
$(window).off 'beforeunload'
window.shutdown()
atom.setRootViewStateForPath(projectPath, null)
describe "keymap.", ->
event = null

View File

@ -882,6 +882,7 @@ class Editor extends View
@updateCursorViews()
@updateSelectionViews()
@autoscroll(options)
@trigger 'editor:display-updated'
updateCursorViews: ->
if @newCursors.length > 0