File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -780,7 +780,10 @@ function ( $xpaths ) use ( $element_xpaths ) {
780780 // Check that AMP_Dev_Mode_Sanitizer is registered once in dev mode, and now also with admin bar showing.
781781 add_filter ( 'amp_dev_mode_enabled ' , '__return_true ' );
782782 add_filter ( 'show_admin_bar ' , '__return_true ' );
783- $ sanitizers = amp_get_content_sanitizers ();
783+ wp_localize_script ( 'admin-bar ' , 'myAdminBarStrings ' , [ 'hello ' => 'world ' ] );
784+ wp_scripts ()->done [] = 'admin-bar ' ;
785+ wp_styles ()->done [] = 'admin-bar ' ;
786+ $ sanitizers = amp_get_content_sanitizers ();
784787 $ this ->assertTrue ( is_admin_bar_showing () );
785788 $ this ->assertTrue ( amp_is_dev_mode () );
786789 $ this ->assertArrayHasKey ( 'AMP_Dev_Mode_Sanitizer ' , $ sanitizers );
@@ -790,6 +793,8 @@ function ( $xpaths ) use ( $element_xpaths ) {
790793 [
791794 '//*[ @id = "wpadminbar" ] ' ,
792795 '//*[ @id = "wpadminbar" ]//* ' ,
796+ '//script[ not( @src ) ][ contains( text(), "var myAdminBarStrings =" ) ] ' ,
797+ '//style[ @id = "admin-bar-inline-css" ] ' ,
793798 ]
794799 ),
795800 $ sanitizers ['AMP_Dev_Mode_Sanitizer ' ]['element_xpaths ' ]
You can’t perform that action at this time.
0 commit comments