PHP Classes

File: public/js/tinymce/src/core/src/test/js/module/test/CaretAsserts.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/core/src/test/js/module/test/CaretAsserts.js   Download  
File: public/js/tinymce/src/core/src/test/js/module/test/CaretAsserts.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 1,547 bytes
 

Contents

Class file image Download
define( 'tinymce.core.test.CaretAsserts', [ 'ephox.agar.api.Assertions', 'ephox.mcagar.api.LegacyUnit', 'tinymce.core.dom.DOMUtils' ], function (Assertions, LegacyUnit, DOMUtils) { var assertCaretPosition = function (actual, expected, message) { if (expected === null) { LegacyUnit.strictEqual(actual, expected, message || 'Expected null.'); return; } if (actual === null) { LegacyUnit.strictEqual(actual, expected, message || 'Didn\'t expect null.'); return; } Assertions.assertEq(message, true, expected.isEqual(actual)); }; var assertRange = function (expected, actual) { Assertions.assertEq('startContainers should be equal', true, expected.startContainer === actual.startContainer); Assertions.assertEq('startOffset should be equal', true, expected.startOffset === actual.startOffset); Assertions.assertEq('endContainer should be equal', true, expected.endContainer === actual.endContainer); Assertions.assertEq('endOffset should be equal', true, expected.endOffset === actual.endOffset); }; var createRange = function (startContainer, startOffset, endContainer, endOffset) { var rng = DOMUtils.DOM.createRng(); rng.setStart(startContainer, startOffset); if (endContainer) { rng.setEnd(endContainer, endOffset); } return rng; }; return { createRange: createRange, assertCaretPosition: assertCaretPosition, assertRange: assertRange }; } );