@@ -11,10 +11,11 @@ import {By} from '@angular/platform-browser';
1111import  { NgModule ,  Component ,  Directive ,  ViewChild ,  ViewContainerRef ,  Injector }  from  '@angular/core' ; 
1212import  { MdDialogModule }  from  './index' ; 
1313import  { MdDialog }  from  './dialog' ; 
14- import  { OverlayContainer }  from  '../core' ; 
14+ import  { OverlayContainer ,   ESCAPE }  from  '../core' ; 
1515import  { MdDialogRef }  from  './dialog-ref' ; 
1616import  { MdDialogContainer }  from  './dialog-container' ; 
1717
18+ const  FAKE_ESCAPE_KEY  =  {  keyCode : ESCAPE  }  as  KeyboardEvent ; 
1819
1920describe ( 'MdDialog' ,  ( )  =>  { 
2021  let  dialog : MdDialog ; 
@@ -128,7 +129,7 @@ describe('MdDialog', () => {
128129        viewContainerFixture . debugElement . query ( By . directive ( MdDialogContainer ) ) . componentInstance ; 
129130
130131    // Fake the user pressing the escape key by calling the handler directly. 
131-     dialogContainer . _handleEscapeKey ( ) ; 
132+     dialogContainer . _handleKeydown ( FAKE_ESCAPE_KEY ) ; 
132133    viewContainerFixture . detectChanges ( ) ; 
133134
134135    viewContainerFixture . whenStable ( ) . then ( ( )  =>  { 
@@ -347,7 +348,7 @@ describe('MdDialog', () => {
347348          By . directive ( MdDialogContainer ) ) . componentInstance ; 
348349
349350      // Fake the user pressing the escape key by calling the handler directly. 
350-       dialogContainer . _handleEscapeKey ( ) ; 
351+       dialogContainer . _handleKeydown ( FAKE_ESCAPE_KEY ) ; 
351352
352353      expect ( overlayContainerElement . querySelector ( 'md-dialog-container' ) ) . toBeTruthy ( ) ; 
353354    } ) ; 
0 commit comments