@@ -4,26 +4,16 @@ import {StyleModule} from './index';
44import { By } from '@angular/platform-browser' ;
55import { TAB } from '../keyboard/keycodes' ;
66import { FocusOriginMonitor } from './focus-classes' ;
7- import { PlatformModule } from '../platform/index' ;
8- import { Platform } from '../platform/platform' ;
97
10-
11- // NOTE: Firefox only fires focus & blur events when it is the currently active window.
12- // This is not always the case on our CI setup, therefore we disable tests that depend on these
13- // events firing for Firefox. We may be able to fix this by configuring our CI to start Firefox with
14- // the following preference: focusmanager.testmode = true
15-
16-
17- describe ( 'FocusOriginMonitor' , ( ) => {
8+ fdescribe ( 'FocusOriginMonitor' , ( ) => {
189 let fixture : ComponentFixture < PlainButton > ;
1910 let buttonElement : HTMLElement ;
2011 let buttonRenderer : Renderer ;
2112 let focusOriginMonitor : FocusOriginMonitor ;
22- let platform : Platform ;
2313
2414 beforeEach ( async ( ( ) => {
2515 TestBed . configureTestingModule ( {
26- imports : [ StyleModule , PlatformModule ] ,
16+ imports : [ StyleModule ] ,
2717 declarations : [
2818 PlainButton ,
2919 ] ,
@@ -32,21 +22,18 @@ describe('FocusOriginMonitor', () => {
3222 TestBed . compileComponents ( ) ;
3323 } ) ) ;
3424
35- beforeEach ( inject ( [ FocusOriginMonitor , Platform ] , ( fom : FocusOriginMonitor , pfm : Platform ) => {
25+ beforeEach ( inject ( [ FocusOriginMonitor ] , ( fom : FocusOriginMonitor ) => {
3626 fixture = TestBed . createComponent ( PlainButton ) ;
3727 fixture . detectChanges ( ) ;
3828
3929 buttonElement = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
4030 buttonRenderer = fixture . componentInstance . renderer ;
4131 focusOriginMonitor = fom ;
42- platform = pfm ;
4332
4433 focusOriginMonitor . registerElementForFocusClasses ( buttonElement , buttonRenderer ) ;
4534 } ) ) ;
4635
4736 it ( 'manually registered element should receive focus classes' , async ( ( ) => {
48- if ( platform . FIREFOX ) { return ; }
49-
5037 buttonElement . focus ( ) ;
5138 fixture . detectChanges ( ) ;
5239
@@ -59,8 +46,6 @@ describe('FocusOriginMonitor', () => {
5946 } ) ) ;
6047
6148 it ( 'should detect focus via keyboard' , async ( ( ) => {
62- if ( platform . FIREFOX ) { return ; }
63-
6449 // Simulate focus via keyboard.
6550 dispatchKeydownEvent ( document , TAB ) ;
6651 buttonElement . focus ( ) ;
@@ -79,8 +64,6 @@ describe('FocusOriginMonitor', () => {
7964 } ) ) ;
8065
8166 it ( 'should detect focus via mouse' , async ( ( ) => {
82- if ( platform . FIREFOX ) { return ; }
83-
8467 // Simulate focus via mouse.
8568 dispatchMousedownEvent ( document ) ;
8669 buttonElement . focus ( ) ;
@@ -99,8 +82,6 @@ describe('FocusOriginMonitor', () => {
9982 } ) ) ;
10083
10184 it ( 'should detect programmatic focus' , async ( ( ) => {
102- if ( platform . FIREFOX ) { return ; }
103-
10485 // Programmatically focus.
10586 buttonElement . focus ( ) ;
10687 fixture . detectChanges ( ) ;
@@ -118,8 +99,6 @@ describe('FocusOriginMonitor', () => {
11899 } ) ) ;
119100
120101 it ( 'focusVia keyboard should simulate keyboard focus' , async ( ( ) => {
121- if ( platform . FIREFOX ) { return ; }
122-
123102 focusOriginMonitor . focusVia ( buttonElement , buttonRenderer , 'keyboard' ) ;
124103 fixture . detectChanges ( ) ;
125104
@@ -136,8 +115,6 @@ describe('FocusOriginMonitor', () => {
136115 } ) ) ;
137116
138117 it ( 'focusVia mouse should simulate mouse focus' , async ( ( ) => {
139- if ( platform . FIREFOX ) { return ; }
140-
141118 focusOriginMonitor . focusVia ( buttonElement , buttonRenderer , 'mouse' ) ;
142119 fixture . detectChanges ( ) ;
143120
@@ -154,8 +131,6 @@ describe('FocusOriginMonitor', () => {
154131 } ) ) ;
155132
156133 it ( 'focusVia program should simulate programmatic focus' , async ( ( ) => {
157- if ( platform . FIREFOX ) { return ; }
158-
159134 focusOriginMonitor . focusVia ( buttonElement , buttonRenderer , 'program' ) ;
160135 fixture . detectChanges ( ) ;
161136
@@ -176,11 +151,10 @@ describe('FocusOriginMonitor', () => {
176151describe ( 'cdkFocusClasses' , ( ) => {
177152 let fixture : ComponentFixture < ButtonWithFocusClasses > ;
178153 let buttonElement : HTMLElement ;
179- let platform : Platform ;
180154
181155 beforeEach ( async ( ( ) => {
182156 TestBed . configureTestingModule ( {
183- imports : [ StyleModule , PlatformModule ] ,
157+ imports : [ StyleModule ] ,
184158 declarations : [
185159 ButtonWithFocusClasses ,
186160 ] ,
@@ -189,21 +163,18 @@ describe('cdkFocusClasses', () => {
189163 TestBed . compileComponents ( ) ;
190164 } ) ) ;
191165
192- beforeEach ( inject ( [ Platform ] , ( pfm : Platform ) => {
166+ beforeEach ( ( ) => {
193167 fixture = TestBed . createComponent ( ButtonWithFocusClasses ) ;
194168 fixture . detectChanges ( ) ;
195169
196170 buttonElement = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
197- platform = pfm ;
198- } ) ) ;
171+ } ) ;
199172
200173 it ( 'should initially not be focused' , ( ) => {
201174 expect ( buttonElement . classList . length ) . toBe ( 0 , 'button should not have focus classes' ) ;
202175 } ) ;
203176
204177 it ( 'should detect focus via keyboard' , async ( ( ) => {
205- if ( platform . FIREFOX ) { return ; }
206-
207178 // Simulate focus via keyboard.
208179 dispatchKeydownEvent ( document , TAB ) ;
209180 buttonElement . focus ( ) ;
@@ -222,8 +193,6 @@ describe('cdkFocusClasses', () => {
222193 } ) ) ;
223194
224195 it ( 'should detect focus via mouse' , async ( ( ) => {
225- if ( platform . FIREFOX ) { return ; }
226-
227196 // Simulate focus via mouse.
228197 dispatchMousedownEvent ( document ) ;
229198 buttonElement . focus ( ) ;
@@ -242,8 +211,6 @@ describe('cdkFocusClasses', () => {
242211 } ) ) ;
243212
244213 it ( 'should detect programmatic focus' , async ( ( ) => {
245- if ( platform . FIREFOX ) { return ; }
246-
247214 // Programmatically focus.
248215 buttonElement . focus ( ) ;
249216 fixture . detectChanges ( ) ;
0 commit comments