@@ -30,6 +30,13 @@ const buttonTsPageFileName = `${LIVESYNC_FOLDER}livesync-button-page.ts`;
30
30
const buttonScssPageFileName = `${ LIVESYNC_FOLDER } livesync-button-page.scss` ;
31
31
const labelPageModuleName = `${ LIVESYNC_FOLDER } livesync-label-page` ;
32
32
33
+ const modalViewPageModuleName = `${ LIVESYNC_FOLDER } livesync-modal-view-page` ;
34
+ const modalViewXmlPageFileName = `${ LIVESYNC_FOLDER } livesync-modal-view-page.xml` ;
35
+ const modalViewJsPageFileName = `${ LIVESYNC_FOLDER } livesync-modal-view-page.js` ;
36
+ const modalViewTsPageFileName = `${ LIVESYNC_FOLDER } livesync-modal-view-page.ts` ;
37
+ const modalViewScssPageFileName = `${ LIVESYNC_FOLDER } livesync-modal-view-page.scss` ;
38
+ const modalViewCssFileName = `${ LIVESYNC_FOLDER } livesync-modal-view-page.css` ;
39
+
33
40
const green = new Color ( "green" ) ;
34
41
35
42
export function setUp ( ) {
@@ -111,6 +118,26 @@ export function test_onLiveSync_ModuleContext_MarkupHtml_ScriptTs_StyleScss_File
111
118
] ) ;
112
119
}
113
120
121
+ export function test_onLiveSync_ModalViewClosed_MarkupXml ( ) {
122
+ _test_onLiveSync_ModalViewClosed ( { type : "markup" , path : modalViewXmlPageFileName } ) ;
123
+ }
124
+
125
+ export function test_onLiveSync_ModalViewClosed_ScriptTs ( ) {
126
+ _test_onLiveSync_ModalViewClosed ( { type : "script" , path : modalViewTsPageFileName } ) ;
127
+ }
128
+
129
+ export function test_onLiveSync_ModalViewClosed_ScriptJs ( ) {
130
+ _test_onLiveSync_ModalViewClosed ( { type : "script" , path : modalViewJsPageFileName } ) ;
131
+ }
132
+
133
+ export function test_onLiveSync_ModalViewClosed_StyleCss ( ) {
134
+ _test_onLiveSync_ModalViewClosed ( { type : "style" , path : modalViewCssFileName } ) ;
135
+ }
136
+
137
+ export function test_onLiveSync_ModalViewClosed_StyleScss ( ) {
138
+ _test_onLiveSync_ModalViewClosed ( { type : "style" , path : modalViewScssPageFileName } ) ;
139
+ }
140
+
114
141
function _test_onLiveSync_ModuleContext_AppStyle ( appStyleFileName : string , livesyncStyleFileName : string ) {
115
142
const pageBeforeNavigation = helper . getCurrentPage ( ) ;
116
143
const buttonPage = < Page > createViewFromEntry ( ( { moduleName : buttonPageModuleName } ) ) ;
@@ -209,6 +236,18 @@ function _test_onLiveSync_ModuleReplace_Multiple(context: ModuleContext[]) {
209
236
TKUnit . assertEqual ( pageBeforeNavigation , pageAfterBackNavigation , "Pages are different!" ) ;
210
237
}
211
238
239
+ function _test_onLiveSync_ModalViewClosed ( context : ModuleContext ) {
240
+ const modalViewPage = < Page > createViewFromEntry ( ( { moduleName : modalViewPageModuleName } ) ) ;
241
+ helper . navigateWithHistory ( ( ) => modalViewPage ) ;
242
+ livesync ( { type : context . type , path : context . path } ) ;
243
+
244
+ TKUnit . waitUntilReady ( ( ) => ! ! frame . topmost ( ) ) ;
245
+ const topmostFrame = frame . topmost ( ) ;
246
+ TKUnit . waitUntilReady ( ( ) => topmostFrame . currentPage && topmostFrame . currentPage . isLoaded && topmostFrame . canGoBack ( ) ) ;
247
+
248
+ TKUnit . assertTrue ( topmostFrame . _getRootModalViews ( ) . length === 0 ) ;
249
+ }
250
+
212
251
function livesync ( context : ModuleContext ) {
213
252
const ls = ( < any > global ) . __hmrSyncBackup || global . __onLiveSync ;
214
253
ls ( context ) ;
0 commit comments