@@ -51,6 +51,19 @@ EventDispatcherTest.prototype.testClassNamesOnActiveLoad = function() {
51
51
assertEquals ( 'ns-myfamily-n4-active ns-active' , this . fakeHtmlElement_ . className ) ;
52
52
} ;
53
53
54
+ EventDispatcherTest . prototype . testEventsOnActiveLoad = function ( ) {
55
+ this . eventDispatcher_ . dispatchLoading ( ) ;
56
+ assertTrue ( this . loadingEventCalled_ ) ;
57
+ this . eventDispatcher_ . dispatchFontLoading ( 'fontFamilyLoading' , 'n4' ) ;
58
+ assertTrue ( this . fontLoadingEventCalled_ ) ;
59
+ assertEquals ( 'fontFamilyLoading n4' , this . fontLoading_ ) ;
60
+ this . eventDispatcher_ . dispatchFontActive ( 'fontFamilyActive' , 'n4' ) ;
61
+ assertTrue ( this . fontActiveEventCalled_ ) ;
62
+ assertEquals ( 'fontFamilyActive n4' , this . fontActive_ ) ;
63
+ this . eventDispatcher_ . dispatchActive ( ) ;
64
+ assertTrue ( this . activeEventCalled_ ) ;
65
+ } ;
66
+
54
67
EventDispatcherTest . prototype . testClassNamesOnInactiveFontButActive = function ( ) {
55
68
this . eventDispatcher_ . dispatchLoading ( ) ;
56
69
assertEquals ( 'ns-loading' , this . fakeHtmlElement_ . className ) ;
@@ -62,19 +75,30 @@ EventDispatcherTest.prototype.testClassNamesOnInactiveFontButActive = function()
62
75
assertEquals ( 'ns-myfamily-n4-inactive ns-active' , this . fakeHtmlElement_ . className ) ;
63
76
} ;
64
77
65
- EventDispatcherTest . prototype . testEventsOnActiveLoad = function ( ) {
78
+ EventDispatcherTest . prototype . testEventsOnInactiveFontButActive = function ( ) {
66
79
this . eventDispatcher_ . dispatchLoading ( ) ;
67
80
assertTrue ( this . loadingEventCalled_ ) ;
68
81
this . eventDispatcher_ . dispatchFontLoading ( 'fontFamilyLoading' , 'n4' ) ;
69
82
assertTrue ( this . fontLoadingEventCalled_ ) ;
70
83
assertEquals ( 'fontFamilyLoading n4' , this . fontLoading_ ) ;
71
- this . eventDispatcher_ . dispatchFontActive ( 'fontFamilyActive ', 'n4' ) ;
72
- assertTrue ( this . fontActiveEventCalled_ ) ;
73
- assertEquals ( 'fontFamilyActive n4' , this . fontActive_ ) ;
84
+ this . eventDispatcher_ . dispatchFontInactive ( 'fontFamilyInactive ', 'n4' ) ;
85
+ assertTrue ( this . fontInactvieEventCalled_ ) ;
86
+ assertEquals ( 'fontFamilyInactive n4' , this . fontInactive_ ) ;
74
87
this . eventDispatcher_ . dispatchActive ( ) ;
75
88
assertTrue ( this . activeEventCalled_ ) ;
76
89
} ;
77
90
91
+ EventDispatcherTest . prototype . testClassNamesOnInactiveLoad = function ( ) {
92
+ this . eventDispatcher_ . dispatchLoading ( ) ;
93
+ assertEquals ( 'ns-loading' , this . fakeHtmlElement_ . className ) ;
94
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family' , 'n4' ) ;
95
+ assertEquals ( 'ns-loading ns-myfamily-n4-loading' , this . fakeHtmlElement_ . className ) ;
96
+ this . eventDispatcher_ . dispatchFontInactive ( 'My Family' , 'n4' ) ;
97
+ assertEquals ( 'ns-loading ns-myfamily-n4-inactive' , this . fakeHtmlElement_ . className ) ;
98
+ this . eventDispatcher_ . dispatchInactive ( ) ;
99
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive' , this . fakeHtmlElement_ . className ) ;
100
+ } ;
101
+
78
102
EventDispatcherTest . prototype . testEventsOnInactiveLoad = function ( ) {
79
103
this . eventDispatcher_ . dispatchLoading ( ) ;
80
104
assertTrue ( this . loadingEventCalled_ ) ;
@@ -84,11 +108,21 @@ EventDispatcherTest.prototype.testEventsOnInactiveLoad = function() {
84
108
this . eventDispatcher_ . dispatchFontInactive ( 'fontFamilyInactive' , 'n4' ) ;
85
109
assertTrue ( this . fontInactvieEventCalled_ ) ;
86
110
assertEquals ( 'fontFamilyInactive n4' , this . fontInactive_ ) ;
87
- this . eventDispatcher_ . dispatchActive ( ) ;
88
- assertTrue ( this . activeEventCalled_ ) ;
111
+ this . eventDispatcher_ . dispatchInactive ( ) ;
112
+ assertTrue ( this . inactiveEventCalled_ ) ;
89
113
} ;
90
114
91
- EventDispatcherTest . prototype . testClassNamesOnInactiveLoad = function ( ) {
115
+ EventDispatcherTest . prototype . testClassNamesOnInactive = function ( ) {
116
+ this . eventDispatcher_ . dispatchInactive ( ) ;
117
+ assertEquals ( 'ns-inactive' , this . fakeHtmlElement_ . className ) ;
118
+ } ;
119
+
120
+ EventDispatcherTest . prototype . testEventsOnInactive = function ( ) {
121
+ this . eventDispatcher_ . dispatchInactive ( ) ;
122
+ assertTrue ( this . inactiveEventCalled_ ) ;
123
+ } ;
124
+
125
+ EventDispatcherTest . prototype . testClassNamesOnInactiveThenActiveLoad = function ( ) {
92
126
this . eventDispatcher_ . dispatchLoading ( ) ;
93
127
assertEquals ( 'ns-loading' , this . fakeHtmlElement_ . className ) ;
94
128
this . eventDispatcher_ . dispatchFontLoading ( 'My Family' , 'n4' ) ;
@@ -97,14 +131,69 @@ EventDispatcherTest.prototype.testClassNamesOnInactiveLoad = function() {
97
131
assertEquals ( 'ns-loading ns-myfamily-n4-inactive' , this . fakeHtmlElement_ . className ) ;
98
132
this . eventDispatcher_ . dispatchInactive ( ) ;
99
133
assertEquals ( 'ns-myfamily-n4-inactive ns-inactive' , this . fakeHtmlElement_ . className ) ;
134
+ this . eventDispatcher_ . dispatchLoading ( ) ;
135
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive ns-loading' , this . fakeHtmlElement_ . className ) ;
136
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family 2' , 'n4' ) ;
137
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive ns-loading ns-myfamily2-n4-loading' , this . fakeHtmlElement_ . className ) ;
138
+ this . eventDispatcher_ . dispatchFontActive ( 'My Family 2' , 'n4' ) ;
139
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive ns-loading ns-myfamily2-n4-active' , this . fakeHtmlElement_ . className ) ;
140
+ this . eventDispatcher_ . dispatchActive ( ) ;
141
+ assertEquals ( 'ns-myfamily-n4-inactive ns-myfamily2-n4-active ns-active' , this . fakeHtmlElement_ . className ) ;
100
142
} ;
101
143
102
- EventDispatcherTest . prototype . testClassNamesOnInactive = function ( ) {
144
+ EventDispatcherTest . prototype . testClassNamesOnActiveThenInactiveLoad = function ( ) {
145
+ this . eventDispatcher_ . dispatchLoading ( ) ;
146
+ assertEquals ( 'ns-loading' , this . fakeHtmlElement_ . className ) ;
147
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family' , 'n4' ) ;
148
+ assertEquals ( 'ns-loading ns-myfamily-n4-loading' , this . fakeHtmlElement_ . className ) ;
149
+ this . eventDispatcher_ . dispatchFontActive ( 'My Family' , 'n4' ) ;
150
+ assertEquals ( 'ns-loading ns-myfamily-n4-active' , this . fakeHtmlElement_ . className ) ;
151
+ this . eventDispatcher_ . dispatchActive ( ) ;
152
+ assertEquals ( 'ns-myfamily-n4-active ns-active' , this . fakeHtmlElement_ . className ) ;
153
+ this . eventDispatcher_ . dispatchLoading ( ) ;
154
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-loading' , this . fakeHtmlElement_ . className ) ;
155
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family 2' , 'n4' ) ;
156
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-loading ns-myfamily2-n4-loading' , this . fakeHtmlElement_ . className ) ;
157
+ this . eventDispatcher_ . dispatchFontInactive ( 'My Family 2' , 'n4' ) ;
158
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-loading ns-myfamily2-n4-inactive' , this . fakeHtmlElement_ . className ) ;
103
159
this . eventDispatcher_ . dispatchInactive ( ) ;
104
- assertEquals ( 'ns-inactive' , this . fakeHtmlElement_ . className ) ;
160
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-myfamily2-n4- inactive' , this . fakeHtmlElement_ . className ) ;
105
161
} ;
106
162
107
- EventDispatcherTest . prototype . testEventsOnInactive = function ( ) {
163
+ EventDispatcherTest . prototype . testClassNamesOnActiveThenActiveLoad = function ( ) {
164
+ this . eventDispatcher_ . dispatchLoading ( ) ;
165
+ assertEquals ( 'ns-loading' , this . fakeHtmlElement_ . className ) ;
166
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family' , 'n4' ) ;
167
+ assertEquals ( 'ns-loading ns-myfamily-n4-loading' , this . fakeHtmlElement_ . className ) ;
168
+ this . eventDispatcher_ . dispatchFontActive ( 'My Family' , 'n4' ) ;
169
+ assertEquals ( 'ns-loading ns-myfamily-n4-active' , this . fakeHtmlElement_ . className ) ;
170
+ this . eventDispatcher_ . dispatchActive ( ) ;
171
+ assertEquals ( 'ns-myfamily-n4-active ns-active' , this . fakeHtmlElement_ . className ) ;
172
+ this . eventDispatcher_ . dispatchLoading ( ) ;
173
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-loading' , this . fakeHtmlElement_ . className ) ;
174
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family 2' , 'n4' ) ;
175
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-loading ns-myfamily2-n4-loading' , this . fakeHtmlElement_ . className ) ;
176
+ this . eventDispatcher_ . dispatchFontActive ( 'My Family 2' , 'n4' ) ;
177
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-loading ns-myfamily2-n4-active' , this . fakeHtmlElement_ . className ) ;
178
+ this . eventDispatcher_ . dispatchActive ( ) ;
179
+ assertEquals ( 'ns-myfamily-n4-active ns-active ns-myfamily2-n4-active' , this . fakeHtmlElement_ . className ) ;
180
+ } ;
181
+
182
+ EventDispatcherTest . prototype . testClassNamesOnInactiveThenInactiveLoad = function ( ) {
183
+ this . eventDispatcher_ . dispatchLoading ( ) ;
184
+ assertEquals ( 'ns-loading' , this . fakeHtmlElement_ . className ) ;
185
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family' , 'n4' ) ;
186
+ assertEquals ( 'ns-loading ns-myfamily-n4-loading' , this . fakeHtmlElement_ . className ) ;
187
+ this . eventDispatcher_ . dispatchFontInactive ( 'My Family' , 'n4' ) ;
188
+ assertEquals ( 'ns-loading ns-myfamily-n4-inactive' , this . fakeHtmlElement_ . className ) ;
108
189
this . eventDispatcher_ . dispatchInactive ( ) ;
109
- assertTrue ( this . inactiveEventCalled_ ) ;
190
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive' , this . fakeHtmlElement_ . className ) ;
191
+ this . eventDispatcher_ . dispatchLoading ( ) ;
192
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive ns-loading' , this . fakeHtmlElement_ . className ) ;
193
+ this . eventDispatcher_ . dispatchFontLoading ( 'My Family 2' , 'n4' ) ;
194
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive ns-loading ns-myfamily2-n4-loading' , this . fakeHtmlElement_ . className ) ;
195
+ this . eventDispatcher_ . dispatchFontInactive ( 'My Family 2' , 'n4' ) ;
196
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive ns-loading ns-myfamily2-n4-inactive' , this . fakeHtmlElement_ . className ) ;
197
+ this . eventDispatcher_ . dispatchInactive ( ) ;
198
+ assertEquals ( 'ns-myfamily-n4-inactive ns-inactive ns-myfamily2-n4-inactive' , this . fakeHtmlElement_ . className ) ;
110
199
} ;
0 commit comments