mediawiki-extensions-Visual.../modules/ve-mw/tests/ve.test.utils.js
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00

24 lines
714 B
JavaScript

/*!
* VisualEditor MediaWiki test utilities.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
ve.test.utils.createSurfaceFromDocument = function ( doc ) {
// Prevent the target from setting up the surface immediately
ve.init.platform.initialized = $.Deferred();
// HACK: MW targets are async and heavy, use an SA target but
// override the global registration
var target = new ve.init.sa.Target(),
mwTarget = new ve.init.mw.Target();
$( '#qunit-fixture' ).append( target.$element );
target.addSurface( doc );
ve.init.platform.initialized.resolve();
mwTarget = null;
target.addSurface( doc );
return target.surface;
};