mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Reset view registry in AtomEnvironment::reset
This commit is contained in:
@@ -22,6 +22,7 @@ describe "TextEditorComponent", ->
|
||||
nextAnimationFrame = noAnimationFrame
|
||||
|
||||
spyOn(window, 'requestAnimationFrame').andCallFake (fn) ->
|
||||
debugger if global.debug
|
||||
nextAnimationFrame = ->
|
||||
nextAnimationFrame = noAnimationFrame
|
||||
fn()
|
||||
@@ -54,6 +55,10 @@ describe "TextEditorComponent", ->
|
||||
component.measureDimensions()
|
||||
nextAnimationFrame()
|
||||
|
||||
# Mutating the DOM in the previous frame causes a document poll; clear it here
|
||||
waits 0
|
||||
runs -> nextAnimationFrame()
|
||||
|
||||
afterEach ->
|
||||
contentNode.style.width = ''
|
||||
|
||||
|
||||
@@ -226,6 +226,9 @@ class AtomEnvironment extends Model
|
||||
@deserializers.clear()
|
||||
@registerDefaultDeserializers()
|
||||
|
||||
@views.clear()
|
||||
@registerDefaultViewProviders()
|
||||
|
||||
@config.clear()
|
||||
@setConfigSchema()
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ class ViewRegistry
|
||||
minimumPollInterval: 200
|
||||
|
||||
constructor: (@atomEnvironment) ->
|
||||
@observer = new MutationObserver(@requestDocumentPoll)
|
||||
@clear()
|
||||
|
||||
clear: ->
|
||||
@views = new WeakMap
|
||||
@providers = []
|
||||
@documentWriters = []
|
||||
@documentReaders = []
|
||||
@documentPollers = []
|
||||
|
||||
@observer = new MutationObserver(@requestDocumentPoll)
|
||||
@debouncedPerformDocumentPoll = _.throttle(@performDocumentPoll, @minimumPollInterval).bind(this)
|
||||
@clearDocumentRequests()
|
||||
|
||||
# Essential: Add a provider that will be used to construct views in the
|
||||
# workspace's view layer based on model objects in its model layer.
|
||||
|
||||
Reference in New Issue
Block a user