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 @@ -784,7 +784,10 @@ function ( $xpaths ) use ( $element_xpaths ) {
784784 // Check that AMP_Dev_Mode_Sanitizer is registered once in dev mode, and now also with admin bar showing.
785785 add_filter ( 'amp_dev_mode_enabled ' , '__return_true ' );
786786 add_filter ( 'show_admin_bar ' , '__return_true ' );
787- $ sanitizers = amp_get_content_sanitizers ();
787+ wp_localize_script ( 'admin-bar ' , 'myAdminBarStrings ' , [ 'hello ' => 'world ' ] );
788+ wp_scripts ()->done [] = 'admin-bar ' ;
789+ wp_styles ()->done [] = 'admin-bar ' ;
790+ $ sanitizers = amp_get_content_sanitizers ();
788791 $ this ->assertTrue ( is_admin_bar_showing () );
789792 $ this ->assertTrue ( amp_is_dev_mode () );
790793 $ this ->assertArrayHasKey ( 'AMP_Dev_Mode_Sanitizer ' , $ sanitizers );
@@ -794,6 +797,8 @@ function ( $xpaths ) use ( $element_xpaths ) {
794797 [
795798 '//*[ @id = "wpadminbar" ] ' ,
796799 '//*[ @id = "wpadminbar" ]//* ' ,
800+ '//script[ not( @src ) ][ contains( text(), "var myAdminBarStrings =" ) ] ' ,
801+ '//style[ @id = "admin-bar-inline-css" ] ' ,
797802 ]
798803 ),
799804 $ sanitizers ['AMP_Dev_Mode_Sanitizer ' ]['element_xpaths ' ]
You can’t perform that action at this time.
0 commit comments