_acs-templating__templates_and_scripts (private)

 _acs-templating__templates_and_scripts

Defined in packages/acs-templating/tcl/test/parse-test-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 _ _ (public) aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_section aa_section (public) _acs-templating__templates_and_scripts _acs-templating__templates_and_scripts _acs-templating__templates_and_scripts->_ _acs-templating__templates_and_scripts->aa_equals _acs-templating__templates_and_scripts->aa_log _acs-templating__templates_and_scripts->aa_log_result _acs-templating__templates_and_scripts->aa_section

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        #
        # Other tests might already have set handlers on the
        # page. Let's reset them beforehand.
        #
        template::prepare_body_script_multirow
        template::get_body_event_handlers
        template::prepare_body_script_multirow
        set starting_body_scripts [template::multirow size body_script]

        #
        # Note: we use placeholders instead of real values to better
        # find them in the output.
        #

        aa_section template::add_body_handler

        template::add_body_handler  -event __template::add_body_handler_event  -script __template::add_body_handler_script  -identifier __template::add_body_handler_identifier

        template::add_body_handler  -event __template::add_body_handler_event  -script __template::add_body_handler_script  -identifier __template::add_body_handler_identifier

        template::add_body_handler  -event __template::add_body_handler_event2  -script __template::add_body_handler_script2  -identifier __template::add_body_handler_identifier2


        aa_section template::add_body_script

        template::add_body_script  -charset __template::add_body_script_charset  -crossorigin __template::add_body_script_crossorigin  -integrity __template::add_body_script_integrity  -script __template::add_body_script_script  -src __template::add_body_script_src  -type __template::add_body_script_type  -async=false  -defer=false


        aa_section template::add_confirm_handler

        template::add_confirm_handler  -event __template::add_confirm_handler_event  -message __template::add_confirm_handler_message  -id __template::add_confirm_handler_id

        template::add_confirm_handler  -event __template::add_confirm_handler_event  -message __template::add_confirm_handler_message  -CSSclass __template::add_confirm_handler_CSSclass

        template::add_confirm_handler  -event __template::add_confirm_handler_event  -message __template::add_confirm_handler_message  -formfield {
                __template::add_confirm_handler_formfield1
                __template::add_confirm_handler_formfield2
            }

        template::add_confirm_handler  -event __template::add_confirm_handler_event  -message __template::add_confirm_handler_message  -selector __template::add_confirm_handler_selector


        aa_section template::add_event_listener

        template::add_event_listener  -event __template::add_event_listener_event  -id __template::add_event_listener_id  -script __template::add_event_listener_script

        template::add_event_listener  -event __template::add_event_listener_event  -CSSclass __template::add_event_listener_CSSclass  -script __template::add_event_listener_script

        template::add_event_listener  -event __template::add_event_listener_event  -formfield {
                __template::add_event_listener_formfield1
                __template::add_event_listener_formfield2
            }  -script __template::add_event_listener_script

        template::add_event_listener  -event __template::add_event_listener_event  -selector __template::add_event_listener_selector  -script __template::add_event_listener_script


        aa_section template::add_refresh_on_history_handler

        template::add_refresh_on_history_handler

        set page [template::collect_body_scripts]

        aa_equals "Page contains exactly 11 additional scripts (body handlers are grouped together)"  [regsub -all "<script" $page {} _] [expr {$starting_body_scripts + 11}]

        aa_true "There is a nonce declaration in the page " [regexp {nonce="\w*"} $page nonce]
        if {[info exists nonce]} {
            aa_equals "All nonces on the page are the same, one per script"  [regsub -all $nonce $page {} _] [expr {$starting_body_scripts + 11}]
        }

        aa_equals "Page contains only 1 handler per identifier"  [regsub -all __template::add_body_handler_script\[^2\] $page {} _] 1

        foreach expected {
            __template::add_body_handler_event
            __template::add_body_handler_script
            __template::add_body_handler_event2
            __template::add_body_handler_script2
            {charset="__template::add_body_script_charset"}
            {crossorigin="__template::add_body_script_crossorigin"}
            {integrity="__template::add_body_script_integrity"}
            __template::add_body_script_script
            {src="__template::add_body_script_src"}
            {type="__template::add_body_script_type"}
            __template::add_confirm_handler_event
            "if (!confirm(`__template::add_confirm_handler_message`)) \{"
            __template::add_confirm_handler_id
            __template::add_confirm_handler_CSSclass
            __template::add_confirm_handler_formfield1
            __template::add_confirm_handler_formfield2
            __template::add_confirm_handler_selector
            __template::add_event_listener_event
            __template::add_event_listener_id
            __template::add_event_listener_script
            __template::add_event_listener_CSSclass
            __template::add_event_listener_formfield1
            __template::add_event_listener_formfield2
            __template::add_event_listener_selector
            "window.addEventListener( \"pageshow\""
        } {
            aa_true "'$expected' was rendered by the template"  {[string first $expected $page] >= 0}
        }
    }} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "templates_and_scripts (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: