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 ) {
784
784
// Check that AMP_Dev_Mode_Sanitizer is registered once in dev mode, and now also with admin bar showing.
785
785
add_filter ( 'amp_dev_mode_enabled ' , '__return_true ' );
786
786
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 ();
788
791
$ this ->assertTrue ( is_admin_bar_showing () );
789
792
$ this ->assertTrue ( amp_is_dev_mode () );
790
793
$ this ->assertArrayHasKey ( 'AMP_Dev_Mode_Sanitizer ' , $ sanitizers );
@@ -794,6 +797,8 @@ function ( $xpaths ) use ( $element_xpaths ) {
794
797
[
795
798
'//*[ @id = "wpadminbar" ] ' ,
796
799
'//*[ @id = "wpadminbar" ]//* ' ,
800
+ '//script[ not( @src ) ][ contains( text(), "var myAdminBarStrings =" ) ] ' ,
801
+ '//style[ @id = "admin-bar-inline-css" ] ' ,
797
802
]
798
803
),
799
804
$ sanitizers ['AMP_Dev_Mode_Sanitizer ' ]['element_xpaths ' ]
You can’t perform that action at this time.
0 commit comments