forked from ariatemplates/ariatemplates
/
MultiSelect.js
47 lines (43 loc) · 1.5 KB
/
MultiSelect.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Aria.classDefinition({
$classpath : "test.aria.widgets.form.multiselect.issue223.MultiSelect",
$extends : "aria.jsunit.TemplateTestCase",
$prototype : {
/**
* This method is always the first entry point to a template test Start the test by opening the MultiSelect
* popup.
*/
runTemplateTest : function () {
this.assertTrue(this.getInputField("ms1").value === "");
this.getInputField("ms1").focus();
aria.core.Timer.addCallback({
fn : function() {
this.synEvent.type(this.getInputField("ms1"), "AF,AC,DL,AY", {
fn : this._afterTyping,
scope : this
});
},
scope : this,
delay : 25
});
},
_afterTyping : function () {
this.assertTrue(this.getInputField("ms1").value === "AF,AC,DL,AY");
aria.core.Timer.addCallback({
fn : this.finishTest,
scope : this,
delay : 100
});
},
finishTest : function () {
this.getInputField("myTextField").focus();
aria.core.Timer.addCallback({
fn : function() {
this.assertTrue(this.getInputField("ms1").value === "AF,AC,DL");
this.end();
},
scope : this,
delay : 25
});
}
}
});