* test: add ensureNoDisposablesAreLeakedInTestSuite
* fix: register moar disposables
* chore: adjust some registrations
* chore: preferencesService is a singleton
* fix: revert to registering the input within the singleton
* make TestEditorService disposable and dispose its inputs
* rm leak
---------
Co-authored-by: Connor Peet <connor@peet.io>
Adds a lint rule that ensures ensureNoDisposablesAreLeakedInTestSuite
is called in suites. It grandfathers in existing files that were lacking
the call entirely.
This PR also includes manual fixes to files that used the function
already but were missing it in one or more suites, which the lint rule
detects.
This adds an `assertHeap` function that can be used in tests. It
takes a heap snapshot, and asserts the state of classes in memory. This
works in Node and the Electron sandbox, but is a no-op in the browser.
Snapshots are process asynchronously and will report failures at the end
of the suite.
This method should be used sparingly (e.g. once at the end of a suite to
ensure nothing leaked before), as gathering a heap snapshot is fairly
slow, at least until V8 11.5.130 (https://v8.dev/blog/speeding-up-v8-heap-snapshots).
When used, the function will ensure the test has a minimum timeout
duration of 20s to avoid immediate failures.
It takes options containing a mapping of class names, and assertion functions
to run on the number of retained instances of that class. For example:
```ts
assertSnapshot({
classes: {
ShouldNeverLeak: count => assert.strictEqual(count, 0),
SomeSingleton: count => assert(count <= 1),
}
});
```
Closes https://github.com/microsoft/vscode/issues/191920
* demo
* wip
* polish
* allow to toggle
* compile
* enable devtools
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* Avoid using global document, global window
* Fix exception caused by reading the size of the newly created window before it is available
* cleanup
* make it more useful
* apply zoom
* first cut editor parts
* cleanup
* scaffold some services
* preserve view state
* simple label distinction
* introduce accessor
* support dnd
* fix open editors view
* share window options
* cleanup
* 💄
* 💄
* 💄
* 💄
* cleanup on unload
* add todo
* stylescleanup
* avoid instanceof checks
* share more styles
* revert changes partially
* fix custom menus
* more alignment to main window
* codicon does not seem to be needed anymore
* no need for isHTMLElement
* fix icon error on macOS
* prevent `document.createElement`
* close child window when main window closes
* better active groups tracking
* cleanup
* pass along editor parts viewer
* eslint rule for instanceof checks
* add dom tests
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
---------
Co-authored-by: Alex Dima <alexdima@microsoft.com>