@@ -108,15 +108,40 @@ public void CanAliasBrowserEvent_StopPropagationIndependentOfNativeEvent()
108
108
{
109
109
var input = Browser . Exists ( By . CssSelector ( "#test-event-target-child input" ) ) ;
110
110
Browser . FindElement ( By . Id ( "register-custom-keydown" ) ) . Click ( ) ;
111
+ Browser . FindElement ( By . Id ( "register-yet-another-keydown" ) ) . Click ( ) ;
111
112
Browser . FindElement ( By . Id ( "custom-keydown-stop-propagation" ) ) . Click ( ) ;
112
113
SendKeysSequentially ( input , "ab" ) ;
113
114
114
115
Browser . Equal ( new [ ]
115
116
{
116
- // The native event still bubbles up to its listener on an ancestor, but the
117
- // custom variant does not bubble up past the stopPropagation point
117
+ // The native event still bubbles up to its listener on an ancestor, and
118
+ // other aliased events still receive it, but the stopPropagation-ed
119
+ // variant does not
118
120
"Received native keydown event" ,
121
+ "Yet another aliased event received: a" ,
119
122
"Received native keydown event" ,
123
+ "Yet another aliased event received: b" ,
124
+ } , GetLogLines ) ;
125
+
126
+ Assert . Equal ( "ab" , input . GetAttribute ( "value" ) ) ;
127
+ }
128
+
129
+ [ Fact ]
130
+ public void CanHaveMultipleAliasesForASingleBrowserEvent ( )
131
+ {
132
+ var input = Browser . Exists ( By . CssSelector ( "#test-event-target-child input" ) ) ;
133
+ Browser . FindElement ( By . Id ( "register-custom-keydown" ) ) . Click ( ) ;
134
+ Browser . FindElement ( By . Id ( "register-yet-another-keydown" ) ) . Click ( ) ;
135
+ SendKeysSequentially ( input , "ab" ) ;
136
+
137
+ Browser . Equal ( new [ ]
138
+ {
139
+ "Received native keydown event" ,
140
+ "You pressed: a" ,
141
+ "Yet another aliased event received: a" ,
142
+ "Received native keydown event" ,
143
+ "You pressed: b" ,
144
+ "Yet another aliased event received: b" ,
120
145
} , GetLogLines ) ;
121
146
122
147
Assert . Equal ( "ab" , input . GetAttribute ( "value" ) ) ;
0 commit comments