extensions.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals bender, CKEDITOR */
  6. 'use strict';
  7. ( function() {
  8. // Make Bender wait to start running tests.
  9. var done = bender.defer();
  10. // Wait for the "ckeditor" module to be ready to start testing.
  11. CKEDITOR.require( [ 'ckeditor' ], done );
  12. /**
  13. * AMD tools related to CKEditor.
  14. */
  15. bender.amd = {
  16. /**
  17. * Gets and object which holds the CKEditor modules guaranteed to be loaded before tests start.
  18. *
  19. * @params {...String} module The name of the module to load.
  20. * @returns {Object} The object that will hold the loaded modules.
  21. */
  22. require: function() {
  23. var modules = {};
  24. var done = bender.defer();
  25. var names = [].slice.call( arguments );
  26. CKEDITOR.require( names, function() {
  27. for ( var i = 0; i < names.length; i++ ) {
  28. modules[ names[ i ] ] = arguments[ i ] ;
  29. }
  30. // Finally give green light for tests to start.
  31. done();
  32. } );
  33. return modules;
  34. }
  35. };
  36. } )();