mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 19:09:29 +00:00
c70d32c017
Depends on I468d4eb4 in core. Uses various hacks to trick the test runner into thinking an MW target is in use, when in fact we still use SA targets. Change-Id: If4611307d5d7aaee4af84f86ef82faf9078043b6
20 lines
658 B
JavaScript
20 lines
658 B
JavaScript
/*!
|
|
* VisualEditor MediaWiki test utilities.
|
|
*
|
|
* @copyright 2011-2014 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 = null;
|
|
// HACK: MW targets are async and heavy, use an SA target but
|
|
// override the global registration
|
|
var target = new ve.init.sa.Target( $( '#qunit-fixture' ), doc ),
|
|
mwTarget = new ve.init.mw.Target( $( '<div>' ).appendTo( $( '#qunit-fixture' ) ) );
|
|
|
|
mwTarget = null;
|
|
target.setup( doc );
|
|
return target.surface;
|
|
};
|