@@ -30,6 +30,13 @@ const buttonTsPageFileName = `${LIVESYNC_FOLDER}livesync-button-page.ts`;
3030const buttonScssPageFileName = `${ LIVESYNC_FOLDER } livesync-button-page.scss` ;
3131const labelPageModuleName = `${ LIVESYNC_FOLDER } livesync-label-page` ;
3232
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+
3340const green = new Color ( "green" ) ;
3441
3542export function setUp ( ) {
@@ -111,6 +118,26 @@ export function test_onLiveSync_ModuleContext_MarkupHtml_ScriptTs_StyleScss_File
111118 ] ) ;
112119}
113120
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+
114141function _test_onLiveSync_ModuleContext_AppStyle ( appStyleFileName : string , livesyncStyleFileName : string ) {
115142 const pageBeforeNavigation = helper . getCurrentPage ( ) ;
116143 const buttonPage = < Page > createViewFromEntry ( ( { moduleName : buttonPageModuleName } ) ) ;
@@ -209,6 +236,18 @@ function _test_onLiveSync_ModuleReplace_Multiple(context: ModuleContext[]) {
209236 TKUnit . assertEqual ( pageBeforeNavigation , pageAfterBackNavigation , "Pages are different!" ) ;
210237}
211238
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+
212251function livesync ( context : ModuleContext ) {
213252 const ls = ( < any > global ) . __hmrSyncBackup || global . __onLiveSync ;
214253 ls ( context ) ;
0 commit comments