jtreg failure handler - replace inline javascript and inline event handlers with same origin javascript files

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 27
    • Affects Version/s: None
    • Component/s: infrastructure
    • master

      jtreg allows for failure handler to be configured when launching the tests. In the JDK repo, we use a failure handler implementation which runs various diagnostic commands and generates HTML report(s) when a test fails, times out or crashes. For better visualization, these HTML report(s) use javascript code (within that HTML file) to expand and collapse each individual "sections" within the HTML content.

      These HTML report(s) can then be viewed to debug the test failures. These reports can either be used locally or served through a web server.

      When served through a web server, the server and browsers (may) employ Content Security Policy https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP restrictions (through HTTP response headers). One such restriction prevents inline javascript and inline javascript event handlers from being run. As a result, the javascript code which deals with the expand/collapse in these HTML report(s), no longer functions and the HTML report ends up with the text from each section being rendered in its entirety. This makes it visually hard to read those reports.

      The recommendation is to move these inline scripts into a separate javascript file, served over the same origin, and replace the inline event handlers with addEventListener() calls.

            Assignee:
            Jaikiran Pai
            Reporter:
            Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: