@@ -477,19 +477,37 @@ describe('input', function() {
477
477
expect ( scope . name ) . toEqual ( 'adam' ) ;
478
478
} ) ;
479
479
480
- it ( 'should not update the model between "compositionstart" and "compositionend"' , function ( ) {
481
- compileInput ( '<input type="text" ng-model="name" name="alias"" />' ) ;
482
- changeInputValueTo ( 'a' ) ;
483
- expect ( scope . name ) . toEqual ( 'a' ) ;
484
- if ( ! ( msie < 9 ) ) {
485
- browserTrigger ( inputElm , 'compositionstart' ) ;
486
- changeInputValueTo ( 'adam' ) ;
487
- expect ( scope . name ) . toEqual ( 'a' ) ;
488
- browserTrigger ( inputElm , 'compositionend' ) ;
489
- }
490
- changeInputValueTo ( 'adam' ) ;
491
- expect ( scope . name ) . toEqual ( 'adam' ) ;
492
- } ) ;
480
+ if ( ! ( msie < 9 ) ) {
481
+ describe ( 'compositionevents' , function ( ) {
482
+ it ( 'should not update the model between "compositionstart" and "compositionend" on non android' , inject ( function ( $sniffer ) {
483
+ $sniffer . android = false ;
484
+
485
+ compileInput ( '<input type="text" ng-model="name" name="alias"" />' ) ;
486
+ changeInputValueTo ( 'a' ) ;
487
+ expect ( scope . name ) . toEqual ( 'a' ) ;
488
+ browserTrigger ( inputElm , 'compositionstart' ) ;
489
+ changeInputValueTo ( 'adam' ) ;
490
+ expect ( scope . name ) . toEqual ( 'a' ) ;
491
+ browserTrigger ( inputElm , 'compositionend' ) ;
492
+ changeInputValueTo ( 'adam' ) ;
493
+ expect ( scope . name ) . toEqual ( 'adam' ) ;
494
+ } ) ) ;
495
+
496
+ it ( 'should update the model between "compositionstart" and "compositionend" on android' , inject ( function ( $sniffer ) {
497
+ $sniffer . android = true ;
498
+
499
+ compileInput ( '<input type="text" ng-model="name" name="alias"" />' ) ;
500
+ changeInputValueTo ( 'a' ) ;
501
+ expect ( scope . name ) . toEqual ( 'a' ) ;
502
+ browserTrigger ( inputElm , 'compositionstart' ) ;
503
+ changeInputValueTo ( 'adam' ) ;
504
+ expect ( scope . name ) . toEqual ( 'adam' ) ;
505
+ browserTrigger ( inputElm , 'compositionend' ) ;
506
+ changeInputValueTo ( 'adam2' ) ;
507
+ expect ( scope . name ) . toEqual ( 'adam2' ) ;
508
+ } ) ) ;
509
+ } ) ;
510
+ }
493
511
494
512
describe ( '"change" event' , function ( ) {
495
513
function assertBrowserSupportsChangeEvent ( inputEventSupported ) {
0 commit comments