Changeset 277212 in webkit


Ignore:
Timestamp:
May 7, 2021 4:59:38 PM (15 months ago)
Author:
Patrick Angle
Message:

Web Inspector: Default source for new test cases is minified
https://bugs.webkit.org/show_bug.cgi?id=225546

Reviewed by Devin Rousso.

Move the placeholder test code to WI.DefaultAudits as part of the non-minified sources so that new audit test
cases do not have their default placeholder script minified. This also allows us to remove
WI.AuditTestCase.stringifyFunction as it is no longer needed.

  • UserInterface/Models/AuditTestCase.js:

(WI.AuditTestCase.stringifyFunction): Deleted.

  • UserInterface/NonMinified/DefaultAudits.js:

(WI.DefaultAudits.newAuditPlaceholder):

  • UserInterface/Views/CreateAuditPopover.js:

(WI.CreateAuditPopover.prototype.dismiss):
(WI.CreateAuditPopover.prototype.dismiss.const.placeholderTestFunction): Deleted.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r276975 r277212  
     12021-05-07  Patrick Angle  <pangle@apple.com>
     2
     3        Web Inspector: Default source for new test cases is minified
     4        https://bugs.webkit.org/show_bug.cgi?id=225546
     5
     6        Reviewed by Devin Rousso.
     7
     8        Move the placeholder test code to `WI.DefaultAudits` as part of the non-minified sources so that new audit test
     9        cases do not have their default placeholder script minified. This also allows us to remove
     10        `WI.AuditTestCase.stringifyFunction` as it is no longer needed.
     11
     12        * UserInterface/Models/AuditTestCase.js:
     13        (WI.AuditTestCase.stringifyFunction): Deleted.
     14        * UserInterface/NonMinified/DefaultAudits.js:
     15        (WI.DefaultAudits.newAuditPlaceholder):
     16        * UserInterface/Views/CreateAuditPopover.js:
     17        (WI.CreateAuditPopover.prototype.dismiss):
     18        (WI.CreateAuditPopover.prototype.dismiss.const.placeholderTestFunction): Deleted.
     19
    1202021-05-04  Devin Rousso  <drousso@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js

    r276616 r277212  
    7878    }
    7979
    80     static stringifyFunction(func, indentLevel)
    81     {
    82         let string = func.toString();
    83 
    84         // Remove spaces to make the function look unindented.
    85         string = string.replaceAll(new RegExp(`^ {${indentLevel}}`, "gm"), "");
    86 
    87         // Replace remaining indentations with the user set indent string.
    88         string = string.replaceAll(/^    /gm, WI.indentString());
    89 
    90         return string;
    91     }
    92 
    9380    // Public
    9481
  • trunk/Source/WebInspectorUI/UserInterface/NonMinified/DefaultAudits.js

    r276680 r277212  
    680680    return {level: domNodes.length ? "fail" : "pass", domNodes, domAttributes: ["aria-hidden"]};
    681681};
     682
     683WI.DefaultAudits.newAuditPlaceholder = function() {
     684    let result = {
     685        level: "pass",
     686    };
     687    return result;
     688};
  • trunk/Source/WebInspectorUI/UserInterface/Views/CreateAuditPopover.js

    r266317 r277212  
    8787    dismiss()
    8888    {
    89         const placeholderTestFunction = function() {
    90             let result = {
    91                 level: "pass",
    92             };
    93             return result;
    94         };
    95         const placeholderTestFunctionString = WI.AuditTestCase.stringifyFunction(placeholderTestFunction, 8);
     89        const placeholderTestFunctionString = WI.DefaultAudits.newAuditPlaceholder.toString();
    9690
    9791        let type = this._typeSelectElement.value;
Note: See TracChangeset for help on using the changeset viewer.