瀏覽代碼

Removed a test that's unnecessary now.

Piotrek Koszuliński 5 年之前
父節點
當前提交
d9b6e9f974

+ 0 - 7
packages/ckeditor5-engine/tests/manual/performance/position.html

@@ -1,7 +0,0 @@
-<div id="test-controls">
-	<button id="run">Run</button>
-</div>
-
-<hr>
-
-<div id="output"></div>

+ 0 - 161
packages/ckeditor5-engine/tests/manual/performance/position.js

@@ -1,161 +0,0 @@
-/**
- * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
-
-/* globals window, document, setTimeout */
-
-document.getElementById( 'run' ).addEventListener( 'click', () => {
-	log( 'Running tests...' );
-
-	setTimeout( async () => {
-		await runTest( 'concat', testConcat );
-		await runTest( 'spread operator', testSpread );
-		await runTest( 'for-loop', testForLoop );
-		await runTest( 'ultra-loop', testUltraForLoop );
-
-		log( 'done' );
-	} );
-} );
-
-window.cache = [];
-
-const output = document.getElementById( 'output' );
-
-function log( line ) {
-	const paragraphElement = document.createElement( 'p' );
-	paragraphElement.innerText = line;
-	output.appendChild( paragraphElement );
-}
-
-function runTest( name, callback ) {
-	return new Promise( resolve => {
-		const start = new Date();
-
-		const repetitions = 10000000;
-
-		const root = {
-			root: 'foo',
-			path: [ 0 ]
-		};
-		const path = [ 0, 2 ];
-
-		for ( let i = 0; i < repetitions; i++ ) {
-			const newPath = callback( root, path );
-			window.cache.push( newPath.length );
-		}
-
-		const end = new Date();
-
-		log( ` > ${ name } took ${ end - start }ms` );
-
-		setTimeout( () => {
-			resolve();
-		}, 50 );
-	} );
-}
-
-class PositionConcat {
-	constructor( root, path, stickiness = 'left' ) {
-		if ( !( path instanceof Array ) || path.length === 0 ) {
-			throw new Error( 'model-position-path-incorrect-format' );
-		}
-
-		path = root.path.concat( path );
-		root = root.root;
-
-		this.root = root;
-		this.path = path;
-		this.stickiness = stickiness;
-	}
-}
-
-class PositionSpread {
-	constructor( root, path, stickiness = 'left' ) {
-		if ( !( path instanceof Array ) || path.length === 0 ) {
-			throw new Error( 'model-position-path-incorrect-format' );
-		}
-
-		path = [ ...root.path, ...path ];
-		root = root.root;
-
-		this.root = root;
-		this.path = path;
-		this.stickiness = stickiness;
-	}
-}
-
-class PositionForLoop {
-	constructor( root, path, stickiness = 'left' ) {
-		if ( !( path instanceof Array ) || path.length === 0 ) {
-			throw new Error( 'model-position-path-incorrect-format' );
-		}
-
-		path = forLoop( root.path, path );
-		root = root.root;
-
-		this.root = root;
-		this.path = path;
-		this.stickiness = stickiness;
-	}
-}
-
-class PositionUltraForLoop {
-	constructor( root, path, stickiness = 'left' ) {
-		if ( !( path instanceof Array ) || path.length === 0 ) {
-			throw new Error( 'model-position-path-incorrect-format' );
-		}
-
-		path = ultraForLoop( root.path, path );
-		root = root.root;
-
-		this.root = root;
-		this.path = path;
-		this.stickiness = stickiness;
-	}
-}
-
-function testConcat( root, path ) {
-	return new PositionConcat( root, path );
-}
-
-function testSpread( root, path ) {
-	return new PositionSpread( root, path );
-}
-
-function testForLoop( root, path ) {
-	return new PositionForLoop( root, path );
-}
-
-function testUltraForLoop( root, path ) {
-	return new PositionUltraForLoop( root, path );
-}
-
-function forLoop( rootPath, path ) {
-	const newPath = [];
-
-	for ( let i = 0; i < rootPath.length; i++ ) {
-		newPath.push( rootPath[ i ] );
-	}
-
-	for ( let i = 0; i < path.length; i++ ) {
-		newPath.push( path[ i ] );
-	}
-
-	return newPath;
-}
-
-function ultraForLoop( rootPath, path ) {
-	const fullLength = rootPath.length + path.length;
-	const newPath = new Array( fullLength );
-
-	for ( let i = 0; i < rootPath.length; i++ ) {
-		newPath[ i ] = rootPath[ i ];
-	}
-
-	for ( let i = 0; i < path.length; i++ ) {
-		newPath[ rootPath.length + i ] = path[ i ];
-	}
-
-	return newPath;
-}

+ 0 - 7
packages/ckeditor5-engine/tests/manual/performance/position.md

@@ -1,7 +0,0 @@
-# Performance: pasting data
-
-1. Begin performance recording in devtools.
-1. Click a button for test.
-1. Stop performance recording.
-
-Note that times reported in web page are total time for a test function (including other operations). In order to verify which methods is fastest always look in on the "total time" of each Position constructor stubs.