OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
test
/
ts
/
browser
/
dom
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:14:55 AM
rwxr-xr-x
📄
ContentCssCorsTest.ts
1.26 KB
02/20/2020 06:13:25 AM
rw-r--r--
📄
ControlSelectionTest.ts
1.8 KB
02/20/2020 06:13:25 AM
rw-r--r--
📄
DimensionsTest.ts
1.59 KB
02/20/2020 06:13:26 AM
rw-r--r--
📄
DomUtilsTest.ts
28.64 KB
02/20/2020 06:13:26 AM
rw-r--r--
📄
ElementTypeTest.ts
4.84 KB
02/20/2020 06:13:27 AM
rw-r--r--
📄
EmptyTest.ts
2 KB
02/20/2020 06:13:27 AM
rw-r--r--
📄
EventUtilsTest.ts
13.79 KB
02/20/2020 06:13:28 AM
rw-r--r--
📄
NodePathTest.ts
1.65 KB
02/20/2020 06:13:28 AM
rw-r--r--
📄
NodeTypeTest.ts
6.15 KB
02/20/2020 06:13:29 AM
rw-r--r--
📄
PaddingBrTest.ts
3.99 KB
02/20/2020 06:13:29 AM
rw-r--r--
📄
ParentsTest.ts
4.24 KB
02/20/2020 06:13:30 AM
rw-r--r--
📄
ScrollIntoViewTest.ts
8.76 KB
02/20/2020 06:13:30 AM
rw-r--r--
📄
SelectionEventsTest.ts
4.32 KB
02/20/2020 06:13:31 AM
rw-r--r--
📄
SelectionQuirksTest.ts
3.6 KB
02/20/2020 06:13:31 AM
rw-r--r--
📄
SelectionTest.ts
52.46 KB
02/20/2020 06:13:33 AM
rw-r--r--
📄
SerializerEventsTest.ts
2.24 KB
02/20/2020 06:13:33 AM
rw-r--r--
📄
SerializerTest.ts
36.74 KB
02/20/2020 06:13:34 AM
rw-r--r--
📄
TreeWalkerTest.ts
2.76 KB
02/20/2020 06:13:34 AM
rw-r--r--
📄
TrimHtmlTest.ts
1.32 KB
02/20/2020 06:13:35 AM
rw-r--r--
📄
TrimNodeTest.ts
1.68 KB
02/20/2020 06:13:35 AM
rw-r--r--
Editing: ControlSelectionTest.ts
Close
import { GeneralSteps, Logger, Pipeline, Step } from '@ephox/agar'; import { TinyApis, TinyLoader } from '@ephox/mcagar'; import { Hierarchy, Element } from '@ephox/sugar'; import Theme from 'tinymce/themes/silver/Theme'; import { UnitTest } from '@ephox/bedrock'; UnitTest.asynctest('browser.tinymce.core.dom.ControlSelectionTest', function (success, failure) { Theme(); const sContextMenuClickInMiddleOf = function (editor, elementPath) { return Step.sync(function () { const element = Hierarchy.follow(Element.fromDom(editor.getBody()), elementPath).getOrDie().dom(); const rect = element.getBoundingClientRect(); const clientX = (rect.left + rect.width / 2), clientY = (rect.top + rect.height / 2); editor.fire('mousedown', { target: element, clientX, clientY, button: 2 }); editor.fire('mouseup', { target: element, clientX, clientY, button: 2 }); editor.fire('contextmenu', { target: element, clientX, clientY, button: 2 }); }); }; TinyLoader.setup(function (editor, onSuccess, onFailure) { const tinyApis = TinyApis(editor); Pipeline.async({}, [ Logger.t('Select image by context menu clicking on it', GeneralSteps.sequence([ Step.label('Focus editor', tinyApis.sFocus), Step.label('Set editor content to a paragraph with a image within', tinyApis.sSetContent('<p><img src="http://www.google.com/google.jpg" width="100" height="100"></p>')), Step.label('Context menu click on the image', sContextMenuClickInMiddleOf(editor, [0, 0])), Step.label('Check that the image is selected', tinyApis.sAssertSelection([0], 0, [0], 1)) ])) ], onSuccess, onFailure); }, { add_unload_trigger: false, base_url: '/project/tinymce/js/tinymce', content_style: 'body.mce-content-body { margin: 0 }' }, success, failure); });