PHP Classes

File: public/js/tinymce/src/core/src/test/js/browser/caret/LineUtilsTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra  >  GoLavaCMS  >  public/js/tinymce/src/core/src/test/js/browser/caret/LineUtilsTest.js  >  Download  
File: public/js/tinymce/src/core/src/test/js/browser/caret/LineUtilsTest.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: 4 years ago
Size: 1,304 bytes
 

Contents

Class file image Download
asynctest(
  'browser.tinymce.core.LineUtilsTest',
  [
    'ephox.mcagar.api.LegacyUnit',
    'ephox.agar.api.Pipeline',
    'tinymce.core.Env',
    'tinymce.core.caret.LineUtils'
  ],
  function (LegacyUnit, Pipeline, Env, LineUtils) {
    var success = arguments[arguments.length - 2];
    var failure = arguments[arguments.length - 1];
    var suite = LegacyUnit.createSuite();

    if (!Env.ceFalse) {
      return;
    }

    var rect = function (x, y, w, h) {
      return {
        left: x,
        top: y,
        bottom: y + h,
        right: x + w,
        width: w,
        height: h
      };
    };

    suite.test('findClosestClientRect', function () {
      LegacyUnit.deepEqual(LineUtils.findClosestClientRect([rect(10, 10, 10, 10), rect(30, 10, 10, 10)], 15), rect(10, 10, 10, 10));
      LegacyUnit.deepEqual(LineUtils.findClosestClientRect([rect(10, 10, 10, 10), rect(30, 10, 10, 10)], 27), rect(30, 10, 10, 10));
      LegacyUnit.deepEqual(LineUtils.findClosestClientRect([rect(10, 10, 10, 10), rect(30, 10, 10, 10)], 23), rect(10, 10, 10, 10));
      LegacyUnit.deepEqual(LineUtils.findClosestClientRect([rect(10, 10, 10, 10), rect(20, 10, 10, 10)], 13), rect(10, 10, 10, 10));
    });

    Pipeline.async({}, suite.toSteps({}), function () {
      success();
    }, failure);
  }
);
For more information send a message to info at phpclasses dot org.