⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246016 in webkit


Ignore:
Timestamp:
Jun 1, 2019, 2:37:49 PM (7 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Canvas: split recording tests into separate files so they don't timeout
https://bugs.webkit.org/show_bug.cgi?id=198459
<rdar://problem/51332026>

Reviewed by Joseph Pecoraro.

  • inspector/canvas/recording.html:
  • inspector/canvas/recording-expected.txt:
  • inspector/canvas/recording-2d.html: Removed.
  • inspector/canvas/recording-2d-expected.txt: Removed.
  • inspector/canvas/console-record-2d.html: Added.
  • inspector/canvas/console-record-2d-expected.txt: Added.
  • inspector/canvas/recording-2d-frameCount.html: Added.
  • inspector/canvas/recording-2d-frameCount-expected.txt: Added.
  • inspector/canvas/recording-2d-full.html: Added.
  • inspector/canvas/recording-2d-full-expected.txt: Added.
  • inspector/canvas/recording-2d-memoryLimit.html: Added.
  • inspector/canvas/recording-2d-memoryLimit-expected.txt: Added.
  • inspector/canvas/recording-2d-saves.html: Added.
  • inspector/canvas/recording-2d-saves-expected.txt: Added.
  • inspector/canvas/resources/recording-2d.js: Added.
  • inspector/canvas/recording-bitmaprenderer.html: Removed.
  • inspector/canvas/recording-bitmaprenderer-expected.txt: Removed.
  • inspector/canvas/console-record-bitmaprenderer.html: Added.
  • inspector/canvas/console-record-bitmaprenderer-expected.txt: Added.
  • inspector/canvas/recording-bitmaprenderer-frameCount.html: Added.
  • inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt: Added.
  • inspector/canvas/recording-bitmaprenderer-full.html: Added.
  • inspector/canvas/recording-bitmaprenderer-full-expected.txt: Added.
  • inspector/canvas/recording-bitmaprenderer-memoryLimit.html: Added.
  • inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt: Added.
  • inspector/canvas/resources/recording-bitmaprenderer.js: Added.
  • inspector/canvas/recording-webgl.html: Removed.
  • inspector/canvas/recording-webgl-expected.txt: Removed.
  • inspector/canvas/console-record-webgl.html: Added.
  • inspector/canvas/console-record-webgl-expected.txt: Added.
  • inspector/canvas/recording-webgl-frameCount.html: Added.
  • inspector/canvas/recording-webgl-frameCount-expected.txt: Added.
  • inspector/canvas/recording-webgl-full.html: Added.
  • inspector/canvas/recording-webgl-full-expected.txt: Added.
  • inspector/canvas/recording-webgl-memoryLimit.html: Added.
  • inspector/canvas/recording-webgl-memoryLimit-expected.txt: Added.
  • inspector/canvas/resources/recording-webgl.js: Added.
  • inspector/canvas/recording-webgl2.html: Removed.
  • inspector/canvas/recording-webgl2-expected.txt: Removed.
  • inspector/canvas/console-record-webgl2.html: Added.
  • inspector/canvas/console-record-webgl2-expected.txt: Added.
  • inspector/canvas/recording-webgl2-frameCount.html: Added.
  • inspector/canvas/recording-webgl2-frameCount-expected.txt: Added.
  • inspector/canvas/recording-webgl2-full.html: Added.
  • inspector/canvas/recording-webgl2-full-expected.txt: Added.
  • inspector/canvas/recording-webgl2-memoryLimit.html: Added.
  • inspector/canvas/recording-webgl2-memoryLimit-expected.txt: Added.
  • inspector/canvas/resources/recording-webgl2.js: Added.
  • TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
Location:
trunk/LayoutTests
Files:
31 added
1 deleted
7 edited
7 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246015 r246016  
     12019-06-01  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Canvas: split recording tests into separate files so they don't timeout
     4        https://bugs.webkit.org/show_bug.cgi?id=198459
     5        <rdar://problem/51332026>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * inspector/canvas/recording.html:
     10        * inspector/canvas/recording-expected.txt:
     11
     12        * inspector/canvas/recording-2d.html: Removed.
     13        * inspector/canvas/recording-2d-expected.txt: Removed.
     14        * inspector/canvas/console-record-2d.html: Added.
     15        * inspector/canvas/console-record-2d-expected.txt: Added.
     16        * inspector/canvas/recording-2d-frameCount.html: Added.
     17        * inspector/canvas/recording-2d-frameCount-expected.txt: Added.
     18        * inspector/canvas/recording-2d-full.html: Added.
     19        * inspector/canvas/recording-2d-full-expected.txt: Added.
     20        * inspector/canvas/recording-2d-memoryLimit.html: Added.
     21        * inspector/canvas/recording-2d-memoryLimit-expected.txt: Added.
     22        * inspector/canvas/recording-2d-saves.html: Added.
     23        * inspector/canvas/recording-2d-saves-expected.txt: Added.
     24        * inspector/canvas/resources/recording-2d.js: Added.
     25
     26        * inspector/canvas/recording-bitmaprenderer.html: Removed.
     27        * inspector/canvas/recording-bitmaprenderer-expected.txt: Removed.
     28        * inspector/canvas/console-record-bitmaprenderer.html: Added.
     29        * inspector/canvas/console-record-bitmaprenderer-expected.txt: Added.
     30        * inspector/canvas/recording-bitmaprenderer-frameCount.html: Added.
     31        * inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt: Added.
     32        * inspector/canvas/recording-bitmaprenderer-full.html: Added.
     33        * inspector/canvas/recording-bitmaprenderer-full-expected.txt: Added.
     34        * inspector/canvas/recording-bitmaprenderer-memoryLimit.html: Added.
     35        * inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt: Added.
     36        * inspector/canvas/resources/recording-bitmaprenderer.js: Added.
     37
     38        * inspector/canvas/recording-webgl.html: Removed.
     39        * inspector/canvas/recording-webgl-expected.txt: Removed.
     40        * inspector/canvas/console-record-webgl.html: Added.
     41        * inspector/canvas/console-record-webgl-expected.txt: Added.
     42        * inspector/canvas/recording-webgl-frameCount.html: Added.
     43        * inspector/canvas/recording-webgl-frameCount-expected.txt: Added.
     44        * inspector/canvas/recording-webgl-full.html: Added.
     45        * inspector/canvas/recording-webgl-full-expected.txt: Added.
     46        * inspector/canvas/recording-webgl-memoryLimit.html: Added.
     47        * inspector/canvas/recording-webgl-memoryLimit-expected.txt: Added.
     48        * inspector/canvas/resources/recording-webgl.js: Added.
     49
     50        * inspector/canvas/recording-webgl2.html: Removed.
     51        * inspector/canvas/recording-webgl2-expected.txt: Removed.
     52        * inspector/canvas/console-record-webgl2.html: Added.
     53        * inspector/canvas/console-record-webgl2-expected.txt: Added.
     54        * inspector/canvas/recording-webgl2-frameCount.html: Added.
     55        * inspector/canvas/recording-webgl2-frameCount-expected.txt: Added.
     56        * inspector/canvas/recording-webgl2-full.html: Added.
     57        * inspector/canvas/recording-webgl2-full-expected.txt: Added.
     58        * inspector/canvas/recording-webgl2-memoryLimit.html: Added.
     59        * inspector/canvas/recording-webgl2-memoryLimit-expected.txt: Added.
     60        * inspector/canvas/resources/recording-webgl2.js: Added.
     61
     62        * TestExpectations:
     63        * platform/gtk/TestExpectations:
     64        * platform/mac/TestExpectations:
     65        * platform/win/TestExpectations:
     66
    1672019-06-01  Devin Rousso  <drousso@apple.com>
    268
  • trunk/LayoutTests/TestExpectations

    r245900 r246016  
    538538# This test is fast enough in release but quite slow in debug builds.
    539539[ Debug ] inspector/debugger/debugger-stack-overflow.html [ Skip ]
    540 [ Debug ] inspector/canvas/recording-2d.html [ Slow ]
    541 [ Debug ] inspector/canvas/recording-webgl.html [ Slow ]
    542 [ Debug ] inspector/canvas/recording-webgl2.html [ Slow ]
    543540
    544541# Debugger stepping tests can timeout if they run slowly due to a short timer scheduled in the frontend.
  • trunk/LayoutTests/inspector/canvas/recording-2d-full-expected.txt

    r246015 r246016  
    33
    44== Running test suite: Canvas.recording2D
    5 -- Running test case: Canvas.recording2D.singleFrame
    6 initialState:
    7   attributes:
    8     width: 2
    9     height: 2
    10   current state:
    11     setTransform: [[1,0,0,1,0,0]]
    12     globalAlpha: 1
    13     globalCompositeOperation: "source-over"
    14     lineWidth: 1
    15     lineCap: "butt"
    16     lineJoin: "miter"
    17     miterLimit: 10
    18     shadowOffsetX: 0
    19     shadowOffsetY: 0
    20     shadowBlur: 0
    21     shadowColor: "rgba(0, 0, 0, 0)"
    22     setLineDash: [[]]
    23     lineDashOffset: 0
    24     font: "10px sans-serif"
    25     textAlign: "start"
    26     textBaseline: "alphabetic"
    27     direction: "ltr"
    28     strokeStyle: "#000000"
    29     fillStyle: "#000000"
    30     imageSmoothingEnabled: true
    31     imageSmoothingQuality: "low"
    32     setPath: [""]
    33   parameters:
    34   content: <filtered>
    35 frames:
    36   0: (duration)
    37     0: arc(1, 2, 3, 4, 5, false)
    38       swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
    39       trace:
    40         0: arc
    41         1: (anonymous function)
    42         2: ignoreException
    43         3: (anonymous function)
    44         4: executeFrameFunction
    45         5: performActions
    46         6: Global Code
    47         7: evaluateWithScopeExtension
    48         8: (anonymous function)
    49         9: _wrapCall
    50     1: arc(6, 7, 8, 9, 10, true)
    51       swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
    52       trace:
    53         0: arc
    54         1: (anonymous function)
    55         2: ignoreException
    56         3: (anonymous function)
    57         4: executeFrameFunction
    58         5: performActions
    59         6: Global Code
    60         7: evaluateWithScopeExtension
    61         8: (anonymous function)
    62         9: _wrapCall
    63 
    645-- Running test case: Canvas.recording2D.multipleFrames
    656initialState:
     
    10891030        1: executeFrameFunction
    10901031
    1091 -- Running test case: Canvas.recording2D.memoryLimit
    1092 initialState:
    1093   attributes:
    1094     width: 2
    1095     height: 2
    1096   current state:
    1097     setTransform: [[1,0,0,1,0,0]]
    1098     globalAlpha: 1
    1099     globalCompositeOperation: "source-over"
    1100     lineWidth: 1
    1101     lineCap: "butt"
    1102     lineJoin: "miter"
    1103     miterLimit: 10
    1104     shadowOffsetX: 0
    1105     shadowOffsetY: 0
    1106     shadowBlur: 0
    1107     shadowColor: "rgba(0, 0, 0, 0)"
    1108     setLineDash: [[]]
    1109     lineDashOffset: 0
    1110     font: "10px sans-serif"
    1111     textAlign: "start"
    1112     textBaseline: "alphabetic"
    1113     direction: "ltr"
    1114     strokeStyle: "#000000"
    1115     fillStyle: "#000000"
    1116     imageSmoothingEnabled: true
    1117     imageSmoothingQuality: "low"
    1118     setPath: [""]
    1119   parameters:
    1120   content: <filtered>
    1121 frames:
    1122   0: (duration) (incomplete)
    1123     0: arc(1, 2, 3, 4, 5, false)
    1124       swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
    1125       trace:
    1126         0: arc
    1127         1: (anonymous function)
    1128         2: ignoreException
    1129         3: (anonymous function)
    1130         4: executeFrameFunction
    1131         5: performActions
    1132         6: Global Code
    1133         7: evaluateWithScopeExtension
    1134         8: (anonymous function)
    1135         9: _wrapCall
    1136 
    1137 -- Running test case: Canvas.recording2D.Console
    1138 PASS: The recording should have the name "TEST".
    1139 PASS: The recording should have one frame.
    1140 PASS: The first frame should have one action.
    1141 
    1142 -- Running test case: Canvas.recording2D.ActionParameterNaN
    1143 PASS: The recording should have 1 frame.
    1144 PASS: The first frame should have 1 action.
    1145 PASS: The action should have 1 parameter.
    1146 PASS: The parameter should be null.
    1147 
    1148 -- Running test case: Canvas.recording2D.ExistingSaves
    1149 PASS: There should be 4 existing states.
    1150 PASS: State 0 should match expected fillStyle value.
    1151 PASS: State 1 should match expected fillStyle value.
    1152 PASS: State 2 should match expected fillStyle value.
    1153 PASS: State 3 should match expected fillStyle value.
    1154 
    1155 -- Running test case: Canvas.recording2D.NoActions
    1156 PASS: A recording should have been started and stopped once.
    1157 PASS: A recording should have been started and stopped twice.
    1158 
  • trunk/LayoutTests/inspector/canvas/recording-expected.txt

    r236957 r246016  
    33
    44== Running test suite: Canvas.recording
    5 -- Running test case: Canvas.multipleRecording
     5-- Running test case: Canvas.ActionParameterNaN
     6PASS: The recording should have 1 frame.
     7PASS: The first frame should have 1 action.
     8PASS: The action should have 1 parameter.
     9PASS: The parameter should be null.
     10
     11-- Running test case: Canvas.MultipleRecording
    612Starting a recording of canvas 1...
    713PASS: Recording started of canvas 1
     
    1521PASS: There should be a recording for canvas 2.
    1622
     23-- Running test case: Canvas.NoActions
     24PASS: A recording should have been started and stopped once.
     25PASS: A recording should have been started and stopped twice.
     26
    1727-- Running test case: Canvas.startRecording.InvalidCanvasId
    1828PASS: Should produce an error.
  • trunk/LayoutTests/inspector/canvas/recording-webgl-full-expected.txt

    r246015 r246016  
    33
    44== Running test suite: Canvas.recordingWebGL
    5 -- Running test case: Canvas.recordingWebGL.singleFrame
    6 initialState:
    7   attributes:
    8     width: 2
    9     height: 2
    10   parameters:
    11     0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
    12   content: <filtered>
    13 frames:
    14   0: (duration)
    15     0: activeTexture(1)
    16       swizzleTypes: [Number]
    17       trace:
    18         0: activeTexture
    19         1: (anonymous function)
    20         2: executeFrameFunction
    21         3: performActions
    22         4: Global Code
    23         5: evaluateWithScopeExtension
    24         6: (anonymous function)
    25         7: _wrapCall
    26 
    275-- Running test case: Canvas.recordingWebGL.multipleFrames
    286initialState:
     
    10281006        1: executeFrameFunction
    10291007
    1030 -- Running test case: Canvas.recordingWebGL.memoryLimit
    1031 initialState:
    1032   attributes:
    1033     width: 2
    1034     height: 2
    1035   parameters:
    1036     0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
    1037   content: <filtered>
    1038 frames:
    1039   0: (duration) (incomplete)
    1040     0: activeTexture(1)
    1041       swizzleTypes: [Number]
    1042       trace:
    1043         0: activeTexture
    1044         1: (anonymous function)
    1045         2: executeFrameFunction
    1046         3: performActions
    1047         4: Global Code
    1048         5: evaluateWithScopeExtension
    1049         6: (anonymous function)
    1050         7: _wrapCall
    1051 
    1052 -- Running test case: Canvas.recordingWebGL.Console
    1053 PASS: The recording should have the name "TEST".
    1054 PASS: The recording should have one frame.
    1055 PASS: The first frame should have one action.
    1056 
  • trunk/LayoutTests/inspector/canvas/recording-webgl2-full-expected.txt

    r246015 r246016  
    33
    44== Running test suite: Canvas.recordingWebGL2
    5 -- Running test case: Canvas.recordingWebGL2.singleFrame
    6 initialState:
    7   attributes:
    8     width: 2
    9     height: 2
    10   parameters:
    11     0: {"alpha":true,"depth":true,"stencil":false,"antialias":false,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
    12   content: <filtered>
    13 frames:
    14   0: (duration)
    15     0: activeTexture(1)
    16       swizzleTypes: [Number]
    17       trace:
    18         0: activeTexture
    19         1: (anonymous function)
    20         2: executeFrameFunction
    21         3: performActions
    22         4: Global Code
    23         5: evaluateWithScopeExtension
    24         6: (anonymous function)
    25         7: _wrapCall
    26 
    275-- Running test case: Canvas.recordingWebGL2.multipleFrames
    286initialState:
     
    995973        1: executeFrameFunction
    996974
    997 -- Running test case: Canvas.recordingWebGL2.memoryLimit
    998 initialState:
    999   attributes:
    1000     width: 2
    1001     height: 2
    1002   parameters:
    1003     0: {"alpha":true,"depth":true,"stencil":false,"antialias":false,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
    1004   content: <filtered>
    1005 frames:
    1006   0: (duration) (incomplete)
    1007     0: activeTexture(1)
    1008       swizzleTypes: [Number]
    1009       trace:
    1010         0: activeTexture
    1011         1: (anonymous function)
    1012         2: executeFrameFunction
    1013         3: performActions
    1014         4: Global Code
    1015         5: evaluateWithScopeExtension
    1016         6: (anonymous function)
    1017         7: _wrapCall
    1018 
    1019 -- Running test case: Canvas.recordingWebGL2.Console
    1020 PASS: The recording should have the name "TEST".
    1021 PASS: The recording should have one frame.
    1022 PASS: The first frame should have one action.
    1023 
  • trunk/LayoutTests/inspector/canvas/recording.html

    r236957 r246016  
    77let contextB = document.createElement("canvas").getContext("2d");
    88
    9 function performActions() {
     9function performActionsNaN() {
     10    contextA.globalAlpha = NaN;
     11}
     12
     13function performActionsMultiple() {
    1014    contextA.fill();
    1115    contextB.fill();
    1216
    13     TestPage.dispatchEventToFrontend("TestPage-performActions");
     17    TestPage.dispatchEventToFrontend("TestPage-performActionsMultiple");
    1418}
    1519
     
    1822
    1923    suite.addTestCase({
    20         name: "Canvas.multipleRecording",
     24        name: "Canvas.ActionParameterNaN",
     25        description: "Check that NaN is converted into the proper value for serialization.",
     26        test(resolve, reject) {
     27            let canvas = WI.canvasManager.canvases[0];
     28            InspectorTest.assert(canvas, "There should be at least one canvas context.");
     29
     30            canvas.awaitEvent(WI.Canvas.Event.RecordingStopped)
     31            .then((event) => {
     32                let recording = event.data.recording.toJSON();
     33
     34                let frames = recording.frames;
     35                InspectorTest.expectEqual(frames.length, 1, "The recording should have 1 frame.");
     36
     37                let actions = frames[0].actions;
     38                InspectorTest.expectEqual(actions.length, 1, "The first frame should have 1 action.");
     39                InspectorTest.expectEqual(actions[0][1].length, 1, "The action should have 1 parameter.");
     40                InspectorTest.expectEqual(actions[0][1][0], null, "The parameter should be null.");
     41            })
     42            .then(resolve, reject);
     43
     44            canvas.awaitEvent(WI.Canvas.Event.RecordingStarted)
     45            .then((event) => {
     46                InspectorTest.evaluateInPage(`performActionsNaN()`);
     47            });
     48
     49            const frameCount = 1;
     50            CanvasAgent.startRecording(canvas.identifier, frameCount)
     51            .catch(reject);
     52        },
     53    });
     54
     55    suite.addTestCase({
     56        name: "Canvas.MultipleRecording",
    2157        description: "Check that multiple recordings are able to be started/stopped at the same time.",
    2258        test(resolve, reject) {
     
    4076            });
    4177
    42             InspectorTest.awaitEvent("TestPage-performActions")
     78            InspectorTest.awaitEvent("TestPage-performActionsMultiple")
    4379            .then((event) => {
    4480                InspectorTest.pass("Actions performed.");
     
    5389
    5490                InspectorTest.log("Performing actions...");
    55                 InspectorTest.evaluateInPage(`performActions()`);
     91                InspectorTest.evaluateInPage(`performActionsMultiple()`);
    5692            });
    5793
     
    66102            InspectorTest.log("Starting a recording of canvas 1...");
    67103            canvases[0].startRecording(singleFrame);
     104        },
     105    });
     106
     107    suite.addTestCase({
     108        name: "Canvas.NoActions",
     109        description: "Check that a canvas is still able to be recorded after stopping a recording with no actions.",
     110        test(resolve, reject) {
     111            let canvas = WI.canvasManager.canvases[0];
     112            InspectorTest.assert(canvas, "There should be at least one canvas context.");
     113
     114            let eventCount = 0;
     115            function handleRecordingStopped(event) {
     116                InspectorTest.assert(!event.data.recording, "The recording payload should be null.");
     117
     118                ++eventCount;
     119                if (eventCount == 1) {
     120                    InspectorTest.pass("A recording should have been started and stopped once.");
     121
     122                    canvas.startRecording();
     123                    canvas.stopRecording();
     124                } else if (eventCount >= 2) {
     125                    InspectorTest.pass("A recording should have been started and stopped twice.");
     126
     127                    canvas.removeEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
     128                    resolve();
     129                }
     130            }
     131            canvas.addEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
     132
     133            canvas.startRecording();
     134            canvas.stopRecording();
    68135        },
    69136    });
  • trunk/LayoutTests/inspector/canvas/resources/recording-2d.js

    r246015 r246016  
    1 <!DOCTYPE html>
    2 <html>
    3 <head>
    4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script>
    5 <script src="resources/recording-utilities.js"></script>
    6 <script>
    71let ctx = null;
    82
     
    431425    ctx.fill();
    432426}
    433 
    434 function performNaNActions() {
    435     ctx.globalAlpha = NaN;
    436 }
    437 
    438 function test() {
    439     let suite = InspectorTest.createAsyncSuite("Canvas.recording2D");
    440 
    441     suite.addTestCase({
    442         name: "Canvas.recording2D.singleFrame",
    443         description: "Check that the recording is stopped after a single frame.",
    444         test(resolve, reject) {
    445             startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject, {frameCount: 1});
    446         },
    447         timeout: -1,
    448     });
    449 
    450     suite.addTestCase({
    451         name: "Canvas.recording2D.multipleFrames",
    452         description: "Check that recording data is serialized correctly for multiple frames.",
    453         test(resolve, reject) {
    454             startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject);
    455         },
    456         timeout: -1,
    457     });
    458 
    459     suite.addTestCase({
    460         name: "Canvas.recording2D.memoryLimit",
    461         description: "Check that the recording is stopped when it reaches the memory limit.",
    462         test(resolve, reject) {
    463             startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject, {memoryLimit: 10});
    464         },
    465         timeout: -1,
    466     });
    467 
    468     suite.addTestCase({
    469         name: "Canvas.recording2D.Console",
    470         description: "Check that a recording can be triggered by console.record().",
    471         test(resolve, reject) {
    472             consoleRecord(WI.Canvas.ContextType.Canvas2D, resolve, reject);
    473         },
    474     });
    475 
    476     suite.addTestCase({
    477         name: "Canvas.recording2D.ActionParameterNaN",
    478         description: "Check that NaN is converted into the proper value for serialization.",
    479         test(resolve, reject) {
    480             let canvas = getCanvas(WI.Canvas.ContextType.Canvas2D);
    481             if (!canvas) {
    482                 reject("Missing 2D canvas.");
    483                 return;
    484             }
    485 
    486             canvas.awaitEvent(WI.Canvas.Event.RecordingStopped)
    487             .then((event) => {
    488                 let recording = event.data.recording.toJSON();
    489 
    490                 let frames = recording.frames;
    491                 InspectorTest.expectEqual(frames.length, 1, "The recording should have 1 frame.");
    492 
    493                 let actions = frames[0].actions;
    494                 InspectorTest.expectEqual(actions.length, 1, "The first frame should have 1 action.");
    495                 InspectorTest.expectEqual(actions[0][1].length, 1, "The action should have 1 parameter.");
    496                 InspectorTest.expectEqual(actions[0][1][0], null, "The parameter should be null.");
    497             })
    498             .then(resolve, reject);
    499 
    500             canvas.awaitEvent(WI.Canvas.Event.RecordingStarted)
    501             .then((event) => {
    502                 InspectorTest.evaluateInPage(`performNaNActions()`);
    503             });
    504 
    505             const frameCount = 1;
    506             CanvasAgent.startRecording(canvas.identifier, frameCount)
    507             .catch(reject);
    508         },
    509     });
    510 
    511     suite.addTestCase({
    512         name: "Canvas.recording2D.ExistingSaves",
    513         description: "Check that existing save calls are sent to the frontend.",
    514         test(resolve, reject) {
    515             let canvas = getCanvas(WI.Canvas.ContextType.Canvas2D);
    516             if (!canvas) {
    517                 reject("Missing 2D canvas.");
    518                 return;
    519             }
    520 
    521             async function logStates(recording) {
    522                 async function compare(index, expected) {
    523                     let state = await WI.RecordingState.swizzleInitialState(recording, recording.initialState.states[index]);
    524                     InspectorTest.expectEqual(state.get("fillStyle"), expected, `State ${index} should match expected fillStyle value.`)
    525                 }
    526 
    527                 await compare(0, "#000000");
    528                 await compare(1, "#ff0000");
    529                 await compare(2, "#00ff00");
    530                 await compare(3, "#0000ff");
    531             }
    532 
    533             canvas.awaitEvent(WI.Canvas.Event.RecordingStopped)
    534             .then((event) => {
    535                 let {recording} = event.data;
    536 
    537                 InspectorTest.expectEqual(recording.initialState.states.length, 4, "There should be 4 existing states.");
    538 
    539                 logStates(recording)
    540                 .then(resolve, reject);
    541             });
    542 
    543             canvas.awaitEvent(WI.Canvas.Event.RecordingStarted)
    544             .then((event) => {
    545                 InspectorTest.evaluateInPage(`performSavePostActions()`).catch(reject);
    546             });
    547 
    548             InspectorTest.evaluateInPage(`performSavePreActions()`)
    549             .then(() => {
    550                 const frameCount = 1;
    551                 CanvasAgent.startRecording(canvas.identifier, frameCount).catch(reject);
    552             }, reject);
    553         },
    554     });
    555 
    556     suite.addTestCase({
    557         name: "Canvas.recording2D.NoActions",
    558         description: "Check that a canvas is still able to be recorded after stopping a recording with no actions.",
    559         test(resolve, reject) {
    560             let canvas = getCanvas(WI.Canvas.ContextType.Canvas2D);
    561             if (!canvas) {
    562                 reject("Missing 2D canvas.");
    563                 return;
    564             }
    565 
    566             let eventCount = 0;
    567             function handleRecordingStopped(event) {
    568                 InspectorTest.assert(!event.data.recording, "The recording payload should be null.");
    569 
    570                 ++eventCount;
    571                 if (eventCount == 1) {
    572                     InspectorTest.pass("A recording should have been started and stopped once.");
    573 
    574                     canvas.startRecording();
    575                     canvas.stopRecording();
    576                 } else if (eventCount >= 2) {
    577                     InspectorTest.pass("A recording should have been started and stopped twice.");
    578 
    579                     canvas.removeEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
    580                     resolve();
    581                 }
    582             }
    583             canvas.addEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
    584 
    585             canvas.startRecording();
    586             canvas.stopRecording();
    587         },
    588     });
    589 
    590     suite.runTestCasesAndFinish();
    591 }
    592 </script>
    593 </head>
    594 <body onload="load()">
    595     <p>Test that CanvasManager is able to record actions made to 2D canvas contexts.</p>
    596 </body>
    597 </html>
  • trunk/LayoutTests/inspector/canvas/resources/recording-bitmaprenderer.js

    r246015 r246016  
    1 <!DOCTYPE html>
    2 <html>
    3 <head>
    4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script>
    5 <script src="resources/recording-utilities.js"></script>
    6 <script>
    71let ctx = null;
    82
     
    8882    ctx.transferFromImageBitmap(blueBitmap);
    8983}
    90 
    91 function test() {
    92     let suite = InspectorTest.createAsyncSuite("Canvas.recordingBitmapRenderer");
    93 
    94     suite.addTestCase({
    95         name: "Canvas.recordingBitmapRenderer.singleFrame",
    96         description: "Check that the recording is stopped after a single frame.",
    97         test(resolve, reject) {
    98             startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject, {frameCount: 1});
    99         },
    100     });
    101 
    102     suite.addTestCase({
    103         name: "Canvas.recordingBitmapRenderer.multipleFrames",
    104         description: "Check that recording data is serialized correctly for multiple frames.",
    105         test(resolve, reject) {
    106             startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject);
    107         },
    108     });
    109 
    110     suite.addTestCase({
    111         name: "Canvas.recordingBitmapRenderer.memoryLimit",
    112         description: "Check that the recording is stopped when it reaches the memory limit.",
    113         test(resolve, reject) {
    114             startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject, {memoryLimit: 10});
    115         },
    116     });
    117 
    118     suite.addTestCase({
    119         name: "Canvas.recordingBitmapRenderer.Console",
    120         description: "Check that a recording can be triggered by console.record().",
    121         test(resolve, reject) {
    122             consoleRecord(WI.Canvas.ContextType.BitmapRenderer, resolve, reject);
    123         },
    124     });
    125 
    126     suite.runTestCasesAndFinish();
    127 }
    128 </script>
    129 </head>
    130 <body onload="load()">
    131     <p>Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.</p>
    132 </body>
    133 </html>
  • trunk/LayoutTests/inspector/canvas/resources/recording-webgl.js

    r246015 r246016  
    1 <!DOCTYPE html>
    2 <html>
    3 <head>
    4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script>
    5 <script src="resources/recording-utilities.js"></script>
    6 <script src="resources/shaderProgram-utilities.js"></script>
    7 <script id="vertex-shader" type="x-shader/x-vertex">
    8     attribute vec4 test;
    9     void main(void) {
    10         gl_Position = test;
    11     }
    12 </script>
    13 <script id="fragment-shader" type="x-shader/x-fragment">
    14     precision mediump float;
    15 
    16     void main(void) {
    17         gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
    18     }
    19 </script>
    20 <script>
    211if (window.internals)
    222    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     
    517497    context.createBuffer();
    518498}
    519 
    520 function test() {
    521     let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL");
    522 
    523     suite.addTestCase({
    524         name: "Canvas.recordingWebGL.singleFrame",
    525         description: "Check that the recording is stopped after a single frame.",
    526         test(resolve, reject) {
    527             startRecording(WI.Canvas.ContextType.WebGL, resolve, reject, {frameCount: 1});
    528         },
    529         timeout: -1,
    530     });
    531 
    532     suite.addTestCase({
    533         name: "Canvas.recordingWebGL.multipleFrames",
    534         description: "Check that recording data is serialized correctly for multiple frames.",
    535         test(resolve, reject) {
    536             startRecording(WI.Canvas.ContextType.WebGL, resolve, reject);
    537         },
    538         timeout: -1,
    539     });
    540 
    541     suite.addTestCase({
    542         name: "Canvas.recordingWebGL.memoryLimit",
    543         description: "Check that the recording is stopped when it reaches the memory limit.",
    544         test(resolve, reject) {
    545             startRecording(WI.Canvas.ContextType.WebGL, resolve, reject, {memoryLimit: 10});
    546         },
    547         timeout: -1,
    548     });
    549 
    550     suite.addTestCase({
    551         name: "Canvas.recordingWebGL.Console",
    552         description: "Check that a recording can be triggered by console.record().",
    553         test(resolve, reject) {
    554             consoleRecord(WI.Canvas.ContextType.WebGL, resolve, reject);
    555         },
    556     });
    557 
    558     suite.runTestCasesAndFinish();
    559 }
    560 </script>
    561 </head>
    562 <body onload="load()">
    563     <p>Test that CanvasManager is able to record actions made to WebGL canvas contexts.</p>
    564 </body>
    565 </html>
  • trunk/LayoutTests/inspector/canvas/resources/recording-webgl2.js

    r246015 r246016  
    1 <!DOCTYPE html>
    2 <html>
    3 <head>
    4 <script src="../../http/tests/inspector/resources/inspector-test.js"></script>
    5 <script src="resources/recording-utilities.js"></script>
    6 <script src="resources/shaderProgram-utilities.js"></script>
    7 <script id="vertex-shader" type="x-shader/x-vertex">
    8     attribute vec4 test;
    9     void main(void) {
    10         gl_Position = test;
    11     }
    12 </script>
    13 <script id="fragment-shader" type="x-shader/x-fragment">
    14     precision mediump float;
    15 
    16     void main(void) {
    17         gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
    18     }
    19 </script>
    20 <script>
    211if (window.internals) {
    222    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     
    508488    context.createBuffer();
    509489}
    510 
    511 function test() {
    512     let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL2");
    513 
    514     suite.addTestCase({
    515         name: "Canvas.recordingWebGL2.singleFrame",
    516         description: "Check that the recording is stopped after a single frame.",
    517         test(resolve, reject) {
    518             startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject, {frameCount: 1});
    519         },
    520         timeout: -1,
    521     });
    522 
    523     suite.addTestCase({
    524         name: "Canvas.recordingWebGL2.multipleFrames",
    525         description: "Check that recording data is serialized correctly for multiple frames.",
    526         test(resolve, reject) {
    527             startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject);
    528         },
    529         timeout: -1,
    530     });
    531 
    532     suite.addTestCase({
    533         name: "Canvas.recordingWebGL2.memoryLimit",
    534         description: "Check that the recording is stopped when it reaches the memory limit.",
    535         test(resolve, reject) {
    536             startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject, {memoryLimit: 10});
    537         },
    538         timeout: -1,
    539     });
    540 
    541     suite.addTestCase({
    542         name: "Canvas.recordingWebGL2.Console",
    543         description: "Check that a recording can be triggered by console.record().",
    544         test(resolve, reject) {
    545             consoleRecord(WI.Canvas.ContextType.WebGL2, resolve, reject);
    546         },
    547     });
    548 
    549     suite.runTestCasesAndFinish();
    550 }
    551 </script>
    552 </head>
    553 <body onload="load()">
    554     <p>Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.</p>
    555 </body>
    556 </html>
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r245788 r246016  
    544544webkit.org/b/166536 fast/canvas/webgl/webgl2-texture-upload-enums.html [ Skip ]
    545545webkit.org/b/166536 inspector/canvas/create-context-webgl2.html [ Skip ]
    546 webkit.org/b/166536 inspector/canvas/recording-webgl2.html [ Skip ]
     546webkit.org/b/166536 inspector/canvas/console-record-webgl2.html [ Skip ]
     547webkit.org/b/166536 inspector/canvas/recording-webgl2-frameCount.html [ Skip ]
     548webkit.org/b/166536 inspector/canvas/recording-webgl2-full.html [ Skip ]
     549webkit.org/b/166536 inspector/canvas/recording-webgl2-memoryLimit.html [ Skip ]
    547550webkit.org/b/166536 inspector/canvas/recording-webgl2-snapshots.html [ Skip ]
    548551webkit.org/b/166536 inspector/canvas/requestContent-webgl2.html [ Skip ]
     
    21932196webkit.org/b/197507 media/destructor-logging-crash.html [ Timeout Pass ]
    21942197
    2195 webkit.org/b/175662 inspector/canvas/recording-2d.html [ Failure Timeout ]
     2198webkit.org/b/175662 inspector/canvas/console-record-2d.html [ Failure Timeout ]
     2199webkit.org/b/175662 inspector/canvas/recording-2d-frameCount.html [ Failure Timeout ]
     2200webkit.org/b/175662 inspector/canvas/recording-2d-full.html [ Failure Timeout ]
     2201webkit.org/b/175662 inspector/canvas/recording-2d-memoryLimit.html [ Failure Timeout ]
     2202webkit.org/b/175662 inspector/canvas/recording-2d-saves.html [ Failure Timeout ]
    21962203
    21972204webkit.org/b/197711 imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html [ Pass Failure ]
     
    37663773webkit.org/b/193323 http/wpt/cache-storage/cache-quota.any.html [ Failure ]
    37673774
    3768 webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer.html [ Failure ]
     3775webkit.org/b/193637 inspector/canvas/console-record-bitmaprenderer.html [ Failure ]
     3776webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer-frameCount.html [ Failure ]
     3777webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer-full.html [ Failure ]
     3778webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer-memoryLimit.html [ Failure ]
    37693779
    37703780webkit.org/b/193638 media/video-webkit-playsinline.html [ Failure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r245999 r246016  
    10281028webkit.org/b/150978 fast/canvas/webgl/oes-texture-half-float-linear.html [ Pass Failure ]
    10291029
     1030webkit.org/b/174066 inspector/canvas/console-record-webgl2.html [ Pass Timeout ]
    10301031webkit.org/b/173931 inspector/canvas/context-attributes.html [ Pass Timeout ]
    10311032webkit.org/b/178028 inspector/canvas/create-context-2d.html [ Pass Timeout ]
    10321033webkit.org/b/174066 inspector/canvas/create-context-webgl2.html [ Pass Timeout ]
    10331034webkit.org/b/174272 inspector/canvas/css-canvas-clients.html [ Pass Failure ]
    1034 webkit.org/b/174066 inspector/canvas/recording-webgl2.html [ Pass Failure Timeout ]
     1035webkit.org/b/174066 inspector/canvas/recording-webgl2-frameCount.html [ Pass Failure Timeout ]
     1036webkit.org/b/174066 inspector/canvas/recording-webgl2-full.html [ Pass Failure Timeout ]
     1037webkit.org/b/174066 inspector/canvas/recording-webgl2-memoryLimit.html [ Pass Failure Timeout ]
    10351038webkit.org/b/174066 inspector/canvas/recording-webgl2-snapshots.html [ Pass Failure Timeout ]
    10361039webkit.org/b/174066 inspector/canvas/shaderProgram-add-remove-webgl2.html [ Pass Failure Timeout ]
  • trunk/LayoutTests/platform/win/TestExpectations

    r245963 r246016  
    19801980http/tests/security/webgl-remote-read-remote-image-allowed-with-credentials.html [ Skip ]
    19811981http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html [ Skip ]
     1982inspector/canvas/console-record-webgl.html [ Skip ]
    19821983inspector/canvas/create-context-webgl.html [ Skip ]
     1984inspector/canvas/console-record-webgl2.html [ Skip ]
    19831985inspector/canvas/create-context-webgl2.html [ Skip ]
    1984 inspector/canvas/recording-webgl.html [ Skip ]
     1986inspector/canvas/recording-webgl-frameCount.html [ Skip ]
     1987inspector/canvas/recording-webgl-full.html [ Skip ]
     1988inspector/canvas/recording-webgl-memoryLimit.html [ Skip ]
    19851989inspector/canvas/recording-webgl-snapshots.html [ Skip ]
    1986 inspector/canvas/recording-webgl2.html [ Skip ]
     1990inspector/canvas/recording-webgl2-frameCount.html [ Skip ]
     1991inspector/canvas/recording-webgl2-full.html [ Skip ]
     1992inspector/canvas/recording-webgl2-memoryLimit.html [ Skip ]
    19871993inspector/canvas/recording-webgl2-snapshots.html [ Skip ]
    19881994inspector/canvas/requestContent-webgl.html [ Skip ]
Note: See TracChangeset for help on using the changeset viewer.