~bac/juju-gui/trunkcopy

« back to all changes in this revision

Viewing changes to lib/yui/tests/editor/tests/editor.js

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
YUI.add('editor-tests', function(Y) {
2
 
 
3
 
 
4
 
    var editor = null,
5
 
    iframe = null,
6
 
    fireKey = function(editor, key) {
7
 
        var inst = editor.getInstance();
8
 
        inst.one('body').simulate('keydown', {
9
 
            keyCode: key
10
 
        });
11
 
 
12
 
        inst.one('body').simulate('keypress', {
13
 
            keyCode: key
14
 
        });
15
 
 
16
 
        inst.one('body').simulate('keyup', {
17
 
            keyCode: key
18
 
        });
19
 
    },
20
 
    template = {
21
 
        name: 'Editor Tests',
22
 
        setUp : function() {
23
 
        },
24
 
        
25
 
        tearDown : function() {
26
 
        },
27
 
        test_load: function() {
28
 
            Y.Assert.isObject(Y.Frame, 'EditorBase was not loaded');
29
 
            Y.Assert.isObject(Y.EditorBase, 'EditorBase was not loaded');
30
 
        },
31
 
        test_frame: function() {
32
 
            var iframeReady = false;
33
 
 
34
 
            iframe = new Y.Frame({
35
 
                container: '#editor',
36
 
                designMode: true,
37
 
                content: 'This is a test.',
38
 
                use: ['node','selector-css3', 'dd-drag', 'dd-ddm']
39
 
            });
40
 
            Y.Assert.isInstanceOf(Y.Frame, iframe, 'Iframe instance can not be created');
41
 
            
42
 
            iframe.after('ready', function() {
43
 
                iframeReady = true;
44
 
            });
45
 
            iframe.render();
46
 
 
47
 
            this.wait(function() {
48
 
                Y.Assert.isTrue(iframeReady, 'IFRAME ready event did not fire');
49
 
                var inst = iframe.getInstance();
50
 
 
51
 
                Y.Assert.isInstanceOf(YUI, inst, 'Internal instance not created');
52
 
                Y.Assert.isObject(inst.DD.Drag, 'DD Not loaded inside the frame');
53
 
                Y.Assert.isObject(inst.DD.DDM, 'DD Not loaded inside the frame');
54
 
                
55
 
 
56
 
            }, 1500);
57
 
            
58
 
        },
59
 
        test_frame_use: function() {
60
 
            var inst = iframe.getInstance(),
61
 
                test = this;
62
 
 
63
 
            iframe.use('slider', function() {
64
 
                test.resume(function() {
65
 
                    Y.Assert.isObject(inst.Slider, 'Failed to load Slider inside frame object');
66
 
                });
67
 
            });
68
 
 
69
 
            test.wait();
70
 
 
71
 
        },
72
 
        test_frame_general: function() {
73
 
            var n = iframe.get('node');
74
 
            var e = Y.one('#editor iframe');
75
 
            Y.Assert.areSame(n, e, 'iframe node getter failed');
76
 
            
77
 
            iframe._fixIECursors();
78
 
 
79
 
            iframe.delegate('click', function() {});
80
 
 
81
 
            var id = iframe.get('id');
82
 
            Y.Assert.isTrue((id.indexOf('iframe-yui') === 0));
83
 
 
84
 
        },
85
 
        'test: _DOMPaste': function() {
86
 
            var OT = 'ORIGINAL_TARGET',
87
 
            fired = false;
88
 
            
89
 
            var inst = iframe.getInstance(),
90
 
            win = inst.config.win;
91
 
 
92
 
            inst.config.win = {
93
 
                clipboardData: {
94
 
                    getData: function() {
95
 
                        return 'foobar'
96
 
                    }
97
 
                }
98
 
            };
99
 
            iframe.on('dom:paste', function(e) {
100
 
                fired = true;
101
 
                Y.Assert.areSame(e.clipboardData.data, 'foobar');
102
 
                Y.Assert.areSame(e.clipboardData.getData(), 'foobar');
103
 
            });
104
 
            iframe._DOMPaste({
105
 
                _event: {
106
 
                    originalTarget: OT,
107
 
                    target: OT,
108
 
                    currentTarget: OT,
109
 
                    clipboardData: {
110
 
                        getData: function() {
111
 
                            return 'foobar'
112
 
                        }
113
 
                    }
114
 
                }
115
 
            });
116
 
 
117
 
            Y.Assert.isTrue(fired);
118
 
 
119
 
            inst.config.win = win;
120
 
 
121
 
        },
122
 
        test_frame_destroy: function() {
123
 
            iframe.destroy();
124
 
 
125
 
            Y.Assert.isNull(Y.one('#editor iframe'), 'iframe DOM node was not destroyed');
126
 
        },
127
 
        test_editor: function() {
128
 
 
129
 
            Y.EditorBase.USE.push('dd');
130
 
            Y.EditorBase.USE.push('node-event-simulate');
131
 
            var iframeReady = false;
132
 
 
133
 
            editor = new Y.EditorBase({
134
 
                content: 'Hello <b>World</b>!!',
135
 
                extracss: 'b { color: red; }'
136
 
            });
137
 
            Y.Assert.isInstanceOf(Y.EditorBase, editor, 'EditorBase instance can not be created');
138
 
            
139
 
            editor.after('ready', function() {
140
 
                iframeReady = true;
141
 
            });
142
 
            editor.on('nodeChange', function(e) {
143
 
                var events = {
144
 
                    'execcommand': true,
145
 
                    'paste': true,
146
 
                    'mouseup': true,
147
 
                    'mousedown': true,
148
 
                    'keydown': true,
149
 
                    'keyup': true,
150
 
                    'keypress': true,
151
 
                    'enter': true,
152
 
                    'enter-up': true,
153
 
                    'enter-down': true,
154
 
                    'enter-press': true
155
 
                };
156
 
                Y.Assert.isTrue(events[e.changedType], 'NodeChange working for ' + e.changedType);
157
 
                if (e.changedType !== 'execcommand') {
158
 
                    Y.Assert.isTrue(e.changedNode.test('b, body'), 'Changed Node');
159
 
                }
160
 
 
161
 
            });
162
 
            editor.render('#editor');
163
 
            editor.hide();
164
 
            editor.show();
165
 
 
166
 
 
167
 
            this.wait(function() {
168
 
                Y.Assert.isTrue(iframeReady, 'IFRAME ready event did not fire');
169
 
                var inst = editor.getInstance();
170
 
 
171
 
                Y.Assert.isInstanceOf(YUI, inst, 'Internal instance not created');
172
 
                Y.Assert.isObject(inst.DD.Drag, 'DD Not loaded inside the frame');
173
 
                Y.Assert.isObject(inst.DD.DDM, 'DD Not loaded inside the frame');
174
 
                Y.Assert.areSame(Y.EditorBase.FILTER_RGB(inst.one('b').getStyle('color')), '#ff0000', 'Extra CSS Failed');
175
 
                inst.one('body').simulate('mousedown', {
176
 
                    pageX: 100,
177
 
                    pageY: 100
178
 
                });
179
 
                inst.one('b').simulate('mousedown');
180
 
                inst.one('body').simulate('mouseup');
181
 
                inst.one('b').simulate('mouseup');
182
 
                
183
 
                fireKey(editor, 13);
184
 
 
185
 
            }, 1500);
186
 
        },
187
 
        test_copy_styles: function() {
188
 
            
189
 
            var node = Y.Node.create('<b><u><div style="font-family: Arial; color: purple">Foo</div></u></b>'),
190
 
                node2 = Y.Node.create('<div/>');
191
 
 
192
 
            editor.copyStyles(node.one('div'), node2);
193
 
 
194
 
            Y.Assert.areSame(node.one('div').getStyle('color'), node2.getStyle('color'), 'Style failed to copy');
195
 
            Y.Assert.areSame(node.one('div').getStyle('fontFamily'), node2.getStyle('fontFamily'), 'Style failed to copy');
196
 
 
197
 
            var node = Y.Node.create('<a>'),
198
 
                node2 = Y.Node.create('<div/>');
199
 
 
200
 
            editor.copyStyles(node, node2);
201
 
 
202
 
        },
203
 
        test_resolve_node: function() {
204
 
            var inst = editor.getInstance();
205
 
            var node = editor._resolveChangedNode(inst.one('html'));
206
 
 
207
 
            Y.Assert.areNotSame(inst.one('html'), node, 'Failed to resolve HTML node');
208
 
 
209
 
            var node = editor._resolveChangedNode(null);
210
 
            Y.Assert.areSame(inst.one('body'), node, 'Failed to resolve HTML node');
211
 
        },
212
 
        test_get_content: function() {
213
 
            var html = editor.getContent(),
214
 
                ex = ((Y.UA.gecko) ? '<br>' : '');
215
 
                if (Y.UA.ie) {
216
 
                    html = html.replace(' style=""', '');
217
 
                }
218
 
            Y.Assert.areEqual(ex + 'Hello <b>World</b>!!'.toLowerCase(), html.toLowerCase(), 'getContent failed to get the editor content');
219
 
        },
220
 
        test_font_size_normalize: function() {
221
 
            var n = Y.Node.create('<span style="font-size: -webkit-xxx-large"></span>');
222
 
            
223
 
            if (Y.UA.webkit) { //Can't apply -webkit styles in something other than webkit, duh..
224
 
                var size = Y.EditorBase.NORMALIZE_FONTSIZE(n);
225
 
                Y.Assert.areSame('48px', size, 'Failed to parse size');
226
 
            }
227
 
            
228
 
            n.setStyle('fontSize', 'xx-large');
229
 
            var size = Y.EditorBase.NORMALIZE_FONTSIZE(n);
230
 
            Y.Assert.areSame('32px', size, 'Failed to parse size');
231
 
 
232
 
            n.setStyle('fontSize', 'x-large');
233
 
            var size = Y.EditorBase.NORMALIZE_FONTSIZE(n);
234
 
            Y.Assert.areSame('24px', size, 'Failed to parse size');
235
 
 
236
 
            n.setStyle('fontSize', 'large');
237
 
            var size = Y.EditorBase.NORMALIZE_FONTSIZE(n);
238
 
            Y.Assert.areSame('18px', size, 'Failed to parse size');
239
 
 
240
 
            n.setStyle('fontSize', 'medium');
241
 
            var size = Y.EditorBase.NORMALIZE_FONTSIZE(n);
242
 
            Y.Assert.areSame('16px', size, 'Failed to parse size');
243
 
 
244
 
            n.setStyle('fontSize', 'small');
245
 
            var size = Y.EditorBase.NORMALIZE_FONTSIZE(n);
246
 
            Y.Assert.areSame('13px', size, 'Failed to parse size');
247
 
 
248
 
            n.setStyle('fontSize', 'x-small');
249
 
            var size = Y.EditorBase.NORMALIZE_FONTSIZE(n);
250
 
            Y.Assert.areSame('10px', size, 'Failed to parse size');
251
 
 
252
 
        },
253
 
        test_selection_font_removal: function() {
254
 
            var inst = editor.getInstance();
255
 
            var node = inst.Node.create('<font face="" style="foo: bar; font-family: ;"></font>');
256
 
            inst.EditorSelection.removeFontFamily(node);
257
 
 
258
 
            Y.Assert.areSame(node.getAttribute('face'), '', 'Failed to remove font face');
259
 
            if (!Y.UA.ie || (Y.UA.ie && Y.UA.ie > 8)) {
260
 
                //IE 6 doesn't like the getAttribute('style') call, it returns an object
261
 
                Y.Assert.isTrue((node.getAttribute('style').indexOf('foo: bar') > -1), 'Failed to remove font-family ;');
262
 
                Y.Assert.isTrue((node.getAttribute('style').indexOf('font-family') === -1), 'Failed to remove font-family ;');
263
 
            }
264
 
 
265
 
            node.setAttribute('style', 'font-family: ');
266
 
            inst.EditorSelection.removeFontFamily(node);
267
 
            Y.Assert.areSame(node.getAttribute('style'), '', 'Failed to remove style attribute');
268
 
        },
269
 
        test_gettext: function() {
270
 
            var inst = editor.getInstance();
271
 
            var node = inst.Node.create('<p><font><strong>This is <i>a test</i></strong></font>');
272
 
 
273
 
            var text = inst.EditorSelection.getText(node);
274
 
            Y.Assert.areSame('This is a test', text, 'Failed to filter out HTML');
275
 
        },
276
 
        test_selection_general: function() {
277
 
            var inst = editor.getInstance();
278
 
 
279
 
            var count = inst.EditorSelection.hasCursor();
280
 
            Y.Assert.areSame(0, count, 'Cursor object found');
281
 
 
282
 
            inst.EditorSelection.cleanCursor();
283
 
 
284
 
            var count = inst.EditorSelection.hasCursor();
285
 
            Y.Assert.areSame(0, count, 'Cursor object found');
286
 
        },
287
 
        test_selection_methods: function() {
288
 
            var inst = editor.getInstance(),
289
 
                sel = new inst.EditorSelection();
290
 
            
291
 
            sel.insertContent('This is a test<br>');
292
 
            editor.execCommand('inserthtml', 'This is another test<br>');
293
 
            
294
 
            editor.execCommand('selectall');
295
 
            editor.execCommand('wrap', 'div');
296
 
            var html = editor.getContent().toLowerCase();
297
 
 
298
 
            sel.setCursor(true);
299
 
 
300
 
 
301
 
            Y.Assert.isTrue(editor.getContent().indexOf('This is a test') > -1, 'Failed to insert content');
302
 
            Y.Assert.isTrue(editor.getContent().indexOf('This is another test') > -1, 'Failed to insert content');
303
 
            Y.Assert.isTrue(html.indexOf('<div>') > -1, 'Failed to wrap the content');
304
 
 
305
 
        },
306
 
        'test: EditorSelection': function() {
307
 
            
308
 
            var inst = editor.getInstance(),
309
 
                sel = new inst.EditorSelection(),
310
 
                html = '<b>Foobar</b>',
311
 
                node = inst.Node.create(html);
312
 
 
313
 
            var n = sel._wrap(node, 'span');
314
 
            Y.Assert.areSame('foobar', n.innerHTML.toLowerCase());
315
 
            Y.Assert.areSame('span', n.tagName.toLowerCase());
316
 
            
317
 
            var a = sel.anchorNode;
318
 
            sel.anchorNode = node;
319
 
 
320
 
            sel.replace('Foobar', 'davglass');
321
 
 
322
 
            //sel.remove();
323
 
 
324
 
            sel.anchorNode = a;
325
 
 
326
 
            Y.Assert.areSame('EditorSelection Object', sel.toString());
327
 
 
328
 
        },
329
 
        test_execCommands: function() {
330
 
            editor.focus(true);
331
 
            /*
332
 
            No Asserts here yet, this test is only to
333
 
            show that there are no syntax errors thrown running
334
 
            an execCommand.
335
 
 
336
 
            I still need to develop a way to properly test these commands
337
 
            */
338
 
            var inst = editor.getInstance();
339
 
            var cmds = Y.Plugin.ExecCommand.COMMANDS;
340
 
            var b = cmds.bidi;
341
 
            Y.each(cmds, function(val, cmd) {
342
 
                if (cmd !== 'bidi') {
343
 
                    editor.execCommand(cmd, '<b>Foo</b>');
344
 
                }
345
 
            });
346
 
            
347
 
            var hc = inst.EditorSelection.hasCursor;
348
 
            inst.EditorSelection.hasCursor = function() { return true };
349
 
 
350
 
            Y.each(cmds, function(val, cmd) {
351
 
                if (cmd !== 'bidi' && cmd != 'insertandfocus') {
352
 
                    editor.execCommand(cmd, '<b>Foo</b>');
353
 
                }
354
 
            });
355
 
            inst.EditorSelection.hasCursor = hc;
356
 
            editor.execCommand('insertandfocus', '<b>Foo</b>');
357
 
 
358
 
            editor.frame._execCommand('bold', '');
359
 
 
360
 
 
361
 
            var SEL = inst.EditorSelection;
362
 
            inst.EditorSelection = function() {
363
 
                var sel = new SEL();
364
 
                sel.isCollapsed = false;
365
 
                return sel;
366
 
            };
367
 
 
368
 
            for (var i in SEL) {
369
 
                inst.EditorSelection[i] = SEL[i];
370
 
            }
371
 
 
372
 
            editor.execCommand('insertorderedlist', '');
373
 
 
374
 
            inst.EditorSelection = SEL;
375
 
 
376
 
        },
377
 
        test_window: function() {
378
 
            Y.Assert.areEqual(Y.Node.getDOMNode(Y.one('#editor iframe').get('contentWindow')), Y.Node.getDOMNode(editor.getInstance().one('win')), 'Window object is not right');
379
 
        },
380
 
        test_doc: function() {
381
 
            Y.Assert.areEqual(Y.Node.getDOMNode(Y.one('#editor iframe').get('contentWindow.document')), Y.Node.getDOMNode(editor.getInstance().one('doc')), 'Document object is not right');
382
 
        },
383
 
        'test: selection.remove()': function() {
384
 
            var inst = editor.getInstance(),
385
 
                sel = new inst.EditorSelection();
386
 
 
387
 
            sel.remove();
388
 
        },
389
 
        test_destroy: function() {
390
 
            editor.destroy();
391
 
            Y.Assert.areEqual(Y.one('#editor iframe'), null, 'Frame was not destroyed');
392
 
        },
393
 
        test_br_plugin: function() {
394
 
            editor = new Y.EditorBase({
395
 
                content: 'Hello <b>World</b>!!',
396
 
                extracss: 'b { color: red; }'
397
 
            });
398
 
            Y.Assert.isInstanceOf(Y.EditorBase, editor, 'Second EditorBase instance can not be created');
399
 
            editor.plug(Y.Plugin.EditorBR);
400
 
            editor.render('#editor');
401
 
            Y.Assert.isInstanceOf(Y.Plugin.EditorBR, editor.editorBR, 'EditorBR was not plugged..');
402
 
            editor.set('content', '<br>');
403
 
 
404
 
            fireKey(editor, 13);
405
 
            fireKey(editor, 8);
406
 
 
407
 
            editor.destroy();
408
 
            Y.Assert.areEqual(Y.one('#editor iframe'), null, 'Second Frame was not destroyed');
409
 
 
410
 
        },
411
 
        test_para_plugin: function() {
412
 
            editor = new Y.EditorBase({
413
 
                content: 'Hello <b>World</b>!!',
414
 
                extracss: 'b { color: red; }'
415
 
            });
416
 
            Y.Assert.isInstanceOf(Y.EditorBase, editor, 'Third EditorBase instance can not be created');
417
 
            editor.plug(Y.Plugin.EditorPara);
418
 
            Y.Assert.isInstanceOf(Y.Plugin.EditorPara, editor.editorPara, 'EditorPara was not plugged..');
419
 
            editor.render('#editor');
420
 
            editor.set('content', '<br><b>Test This</b>');
421
 
 
422
 
            var inst = editor.getInstance();
423
 
 
424
 
            var str = '<b>foo</b>';
425
 
            var out = editor.frame.exec._wrapContent(str);
426
 
            Y.Assert.areEqual('<p><b>foo</b></p>', out);
427
 
 
428
 
            var out = editor.frame.exec._wrapContent(str, true);
429
 
            Y.Assert.areEqual('<b>foo</b><br>', out);
430
 
 
431
 
            fireKey(editor, 13);
432
 
            fireKey(editor, 8);
433
 
            editor.editorPara._fixFirstPara();
434
 
            editor.editorPara._afterPaste();
435
 
            editor.editorPara._onNodeChange({
436
 
                changedEvent: {},
437
 
                changedNode: inst.one('b'),
438
 
                changedType: 'enter-up'
439
 
            });
440
 
            editor.editorPara._onNodeChange({
441
 
                changedEvent: {},
442
 
                changedNode: inst.one('br'),
443
 
                changedType: 'enter'
444
 
            });
445
 
            editor.destroy();
446
 
            Y.Assert.areEqual(Y.one('#editor iframe'), null, 'Third Frame was not destroyed');
447
 
            
448
 
        },
449
 
        test_double_plug_setup: function() {
450
 
            editor = new Y.EditorBase({
451
 
                content: 'Hello <b>World</b>!!',
452
 
                extracss: 'b { color: red; }'
453
 
            });
454
 
            Y.Assert.isInstanceOf(Y.EditorBase, editor, 'Forth EditorBase instance can not be created');
455
 
        },
456
 
        test_double_plug: function() {
457
 
            editor.plug(Y.Plugin.EditorPara);
458
 
            //This should error
459
 
            editor.plug(Y.Plugin.EditorBR);
460
 
        },
461
 
        test_double_down: function() {
462
 
            Y.Assert.isInstanceOf(Y.Plugin.EditorPara, editor.editorPara, 'EditorPara was not plugged..');
463
 
            editor.render('#editor');
464
 
            editor.destroy();
465
 
            Y.Assert.areEqual(Y.one('#editor frame'), null, 'Forth Frame was not destroyed');
466
 
        },
467
 
        test_double_plug_setup2: function() {
468
 
            editor = new Y.EditorBase({
469
 
                content: 'Hello <b>World</b>!!',
470
 
                extracss: 'b { color: red; }'
471
 
            });
472
 
            Y.Assert.isInstanceOf(Y.EditorBase, editor, 'Fifth EditorBase instance can not be created');
473
 
        },
474
 
        test_double_plug2: function() {
475
 
            editor.plug(Y.Plugin.EditorBR);
476
 
            //This should error
477
 
            editor.plug(Y.Plugin.EditorPara);
478
 
        },
479
 
        test_double_down2: function() {
480
 
            Y.Assert.isInstanceOf(Y.Plugin.EditorBR, editor.editorBR, 'EditorBR was not plugged..');
481
 
            editor.render('#editor');
482
 
            editor.destroy();
483
 
            Y.Assert.areEqual(Y.one('#editor frame'), null, 'Fifth Frame was not destroyed');
484
 
        },
485
 
        test_bidi_noplug: function() {
486
 
            editor = new Y.EditorBase({
487
 
                content: 'Hello <b>World</b>!!',
488
 
                extracss: 'b { color: red; }'
489
 
            });
490
 
            editor.render('#editor');
491
 
            this.wait(function() {
492
 
                //This should error
493
 
                editor.execCommand('bidi');
494
 
            }, 1500);
495
 
        },
496
 
        test_bidi_plug: function() {
497
 
            editor.destroy();
498
 
            editor = new Y.EditorBase({
499
 
                content: 'Hello <b>World</b>!!',
500
 
                extracss: 'b { color: red; }'
501
 
            });
502
 
            editor.plug(Y.Plugin.EditorPara);
503
 
            editor.plug(Y.Plugin.EditorBidi);
504
 
            editor.render('#editor');
505
 
            Y.Assert.isInstanceOf(Y.Plugin.EditorBidi, editor.editorBidi, 'EditorBidi plugin failed to load');
506
 
            editor.focus(true);
507
 
 
508
 
            var inst = editor.getInstance();
509
 
            var sel = new inst.EditorSelection();
510
 
            var b = inst.one('b');
511
 
            Y.Assert.areEqual(b.get('parentNode').get('dir'), '', 'Default direction');
512
 
            sel.selectNode(b, true, true);
513
 
            editor.execCommand('bidi');
514
 
            Y.Assert.areEqual(b.get('parentNode').get('dir'), 'rtl', 'RTL not added to node');
515
 
 
516
 
            sel.selectNode(b, true, true);
517
 
            editor.execCommand('bidi');
518
 
            Y.Assert.areEqual(b.get('parentNode').get('dir'), 'ltr', 'LTR not added to node');
519
 
 
520
 
            sel.selectNode(b, true, true);
521
 
            editor.execCommand('bidi');
522
 
            Y.Assert.areEqual(b.get('parentNode').get('dir'), 'rtl', 'RTL not added BACK to node');
523
 
            
524
 
            editor.editorBidi._afterMouseUp();
525
 
            editor.editorBidi._afterNodeChange({
526
 
                changedType: 'end-up'
527
 
            });
528
 
 
529
 
            var out = Y.Plugin.EditorBidi.blockParent(inst.one('body').get('firstChild.firstChild'));
530
 
            Y.Assert.isTrue(out.test('p'));
531
 
 
532
 
            var out = Y.Plugin.EditorBidi.addParents([inst.one('body').get('firstChild')]);
533
 
            Y.Assert.areEqual(1, out.length);
534
 
            Y.Assert.isTrue(out[0].test('p'));
535
 
 
536
 
        },
537
 
        _should: {
538
 
            fail: {
539
 
                'test: EditorSelection': (Y.UA.chrome),
540
 
                test_bidi_plug: (Y.UA.ie && Y.UA.ie === 9),
541
 
                test_selection_methods: ((Y.UA.ie || Y.UA.webkit) ? true : false),
542
 
                test_execCommands: ((Y.UA.webkit || (Y.UA.ie && Y.UA.ie === 9) || Y.UA.chrome) ? true : false)
543
 
 
544
 
            },
545
 
            error: { //These tests should error
546
 
                'test: EditorSelection': (Y.UA.chrome),
547
 
                test_selection_methods: (Y.UA.ie || Y.UA.webkit ? true : false),
548
 
                test_execCommands: ((Y.UA.webkit || (Y.UA.ie && Y.UA.ie === 9) || Y.UA.chrome) ? true : false),
549
 
                test_double_plug: true,
550
 
                test_double_plug2: true,
551
 
                test_bidi_noplug: true
552
 
            }
553
 
        }
554
 
    };
555
 
    
556
 
    var suite = new Y.Test.Suite("Editor");
557
 
    
558
 
    suite.add(new Y.Test.Case(template));
559
 
    Y.Test.Runner.add(suite);
560
 
 
561
 
});