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