Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #35 from ckeditor/t/ckeditor5/1814
Browse files Browse the repository at this point in the history
Tests: Prevented `CKEditorInspector` auto–attachment in the memory consumption manual test. Closes ckeditor/ckeditor5#1814.
  • Loading branch information
oleq authored Jun 18, 2019
2 parents 57f30f3 + 37bd0d3 commit 135c8a8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/manual/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals console:false, document, window */
/* globals console:false, document */

import BalloonEditor from '../../src/ballooneditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';

window.editors = {};

/*
* Memory-leak safe version of balloon editor manual test does not:
* - define global variables (such as let editor; in main file scope)
* - console.log() objects
* - add event listeners with () => {} methods which reference other
*/
function initEditors() {
const editors = {};

init( '#editor-1' );
init( '#editor-2' );

Expand Down Expand Up @@ -59,17 +59,17 @@ function initEditors() {
}
} )
.then( editor => {
window.editors[ selector ] = editor;
editors[ selector ] = editor;
} )
.catch( err => {
console.error( err.stack );
} );
}

function destroyEditors() {
for ( const selector in window.editors ) {
window.editors[ selector ].destroy().then( () => {
window.editors[ selector ] = undefined;
for ( const selector in editors ) {
editors[ selector ].destroy().then( () => {
editors[ selector ] = undefined;
} );
}

Expand Down

0 comments on commit 135c8a8

Please sign in to comment.