Web Inspector: Canvas: split recording tests into separate files so they don't timeout
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jun 2019 21:37:49 +0000 (21:37 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Jun 2019 21:37:49 +0000 (21:37 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246016 268f45cc-cd09-0410-ab3c-d52691b4dbfc

46 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/inspector/canvas/console-record-2d-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/console-record-2d.html [new file with mode: 0644]
LayoutTests/inspector/canvas/console-record-bitmaprenderer-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/console-record-bitmaprenderer.html [new file with mode: 0644]
LayoutTests/inspector/canvas/console-record-webgl-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/console-record-webgl.html [new file with mode: 0644]
LayoutTests/inspector/canvas/console-record-webgl2-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/console-record-webgl2.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-2d-frameCount.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-2d-full-expected.txt [moved from LayoutTests/inspector/canvas/recording-2d-expected.txt with 89% similarity]
LayoutTests/inspector/canvas/recording-2d-full.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-2d-memoryLimit.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-2d-saves-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-2d-saves.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-bitmaprenderer-expected.txt [deleted file]
LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-bitmaprenderer-full-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-bitmaprenderer-full.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-expected.txt
LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl-frameCount.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl-full-expected.txt [moved from LayoutTests/inspector/canvas/recording-webgl-expected.txt with 94% similarity]
LayoutTests/inspector/canvas/recording-webgl-full.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl-memoryLimit.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2-frameCount.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2-full-expected.txt [moved from LayoutTests/inspector/canvas/recording-webgl2-expected.txt with 94% similarity]
LayoutTests/inspector/canvas/recording-webgl2-full.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt [new file with mode: 0644]
LayoutTests/inspector/canvas/recording-webgl2-memoryLimit.html [new file with mode: 0644]
LayoutTests/inspector/canvas/recording.html
LayoutTests/inspector/canvas/resources/recording-2d.js [moved from LayoutTests/inspector/canvas/recording-2d.html with 64% similarity]
LayoutTests/inspector/canvas/resources/recording-bitmaprenderer.js [moved from LayoutTests/inspector/canvas/recording-bitmaprenderer.html with 55% similarity]
LayoutTests/inspector/canvas/resources/recording-webgl.js [moved from LayoutTests/inspector/canvas/recording-webgl.html with 85% similarity]
LayoutTests/inspector/canvas/resources/recording-webgl2.js [moved from LayoutTests/inspector/canvas/recording-webgl2.html with 85% similarity]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations

index a04ee81..5b84718 100644 (file)
@@ -1,5 +1,71 @@
 2019-06-01  Devin Rousso  <drousso@apple.com>
 
+        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:
+
+2019-06-01  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: Canvas: in tests don't manually stop recording if a frame count is specified
         https://bugs.webkit.org/show_bug.cgi?id=198457
         <rdar://problem/48248697>
index d9293c2..9febe3d 100644 (file)
@@ -537,9 +537,6 @@ webkit.org/b/134982 inspector/debugger/setBreakpoint-dfg-and-modify-local.html [
 
 # This test is fast enough in release but quite slow in debug builds.
 [ Debug ] inspector/debugger/debugger-stack-overflow.html [ Skip ]
-[ Debug ] inspector/canvas/recording-2d.html [ Slow ]
-[ Debug ] inspector/canvas/recording-webgl.html [ Slow ]
-[ Debug ] inspector/canvas/recording-webgl2.html [ Slow ]
 
 # Debugger stepping tests can timeout if they run slowly due to a short timer scheduled in the frontend.
 webkit.org/b/161951 [ Debug ] inspector/debugger/paused-scopes.html [ Skip ]
diff --git a/LayoutTests/inspector/canvas/console-record-2d-expected.txt b/LayoutTests/inspector/canvas/console-record-2d-expected.txt
new file mode 100644 (file)
index 0000000..27545f3
--- /dev/null
@@ -0,0 +1,9 @@
+Test that CanvasManager is able to record actions made to 2D canvas contexts.
+
+
+== Running test suite: Canvas.recording2D
+-- Running test case: Canvas.recording2D.Console
+PASS: The recording should have the name "TEST".
+PASS: The recording should have one frame.
+PASS: The first frame should have one action.
+
diff --git a/LayoutTests/inspector/canvas/console-record-2d.html b/LayoutTests/inspector/canvas/console-record-2d.html
new file mode 100644 (file)
index 0000000..af6a43b
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-2d.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recording2D");
+
+    suite.addTestCase({
+        name: "Canvas.recording2D.Console",
+        description: "Check that a recording can be triggered by console.record().",
+        test(resolve, reject) {
+            consoleRecord(WI.Canvas.ContextType.Canvas2D, resolve, reject);
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to 2D canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/console-record-bitmaprenderer-expected.txt b/LayoutTests/inspector/canvas/console-record-bitmaprenderer-expected.txt
new file mode 100644 (file)
index 0000000..13ef4dc
--- /dev/null
@@ -0,0 +1,9 @@
+Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.
+
+
+== Running test suite: Canvas.recordingBitmapRenderer
+-- Running test case: Canvas.recordingBitmapRenderer.Console
+PASS: The recording should have the name "TEST".
+PASS: The recording should have one frame.
+PASS: The first frame should have one action.
+
diff --git a/LayoutTests/inspector/canvas/console-record-bitmaprenderer.html b/LayoutTests/inspector/canvas/console-record-bitmaprenderer.html
new file mode 100644 (file)
index 0000000..01240d6
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-bitmaprenderer.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingBitmapRenderer");
+
+    suite.addTestCase({
+        name: "Canvas.recordingBitmapRenderer.Console",
+        description: "Check that a recording can be triggered by console.record().",
+        test(resolve, reject) {
+            consoleRecord(WI.Canvas.ContextType.BitmapRenderer, resolve, reject);
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/console-record-webgl-expected.txt b/LayoutTests/inspector/canvas/console-record-webgl-expected.txt
new file mode 100644 (file)
index 0000000..61abc97
--- /dev/null
@@ -0,0 +1,9 @@
+Test that CanvasManager is able to record actions made to WebGL canvas contexts.
+
+
+== Running test suite: Canvas.recordingWebGL
+-- Running test case: Canvas.recordingWebGL.Console
+PASS: The recording should have the name "TEST".
+PASS: The recording should have one frame.
+PASS: The first frame should have one action.
+
diff --git a/LayoutTests/inspector/canvas/console-record-webgl.html b/LayoutTests/inspector/canvas/console-record-webgl.html
new file mode 100644 (file)
index 0000000..32f559b
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL.Console",
+        description: "Check that a recording can be triggered by console.record().",
+        test(resolve, reject) {
+            consoleRecord(WI.Canvas.ContextType.WebGL, resolve, reject);
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/console-record-webgl2-expected.txt b/LayoutTests/inspector/canvas/console-record-webgl2-expected.txt
new file mode 100644 (file)
index 0000000..276efdd
--- /dev/null
@@ -0,0 +1,9 @@
+Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.
+
+
+== Running test suite: Canvas.recordingWebGL2
+-- Running test case: Canvas.recordingWebGL2.Console
+PASS: The recording should have the name "TEST".
+PASS: The recording should have one frame.
+PASS: The first frame should have one action.
+
diff --git a/LayoutTests/inspector/canvas/console-record-webgl2.html b/LayoutTests/inspector/canvas/console-record-webgl2.html
new file mode 100644 (file)
index 0000000..13e1a01
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl2.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL2");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL2.Console",
+        description: "Check that a recording can be triggered by console.record().",
+        test(resolve, reject) {
+            consoleRecord(WI.Canvas.ContextType.WebGL2, resolve, reject);
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt b/LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt
new file mode 100644 (file)
index 0000000..b518805
--- /dev/null
@@ -0,0 +1,63 @@
+Test that CanvasManager is able to record actions made to 2D canvas contexts.
+
+
+== Running test suite: Canvas.recording2D
+-- Running test case: Canvas.recording2D.singleFrame
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  current state:
+    setTransform: [[1,0,0,1,0,0]]
+    globalAlpha: 1
+    globalCompositeOperation: "source-over"
+    lineWidth: 1
+    lineCap: "butt"
+    lineJoin: "miter"
+    miterLimit: 10
+    shadowOffsetX: 0
+    shadowOffsetY: 0
+    shadowBlur: 0
+    shadowColor: "rgba(0, 0, 0, 0)"
+    setLineDash: [[]]
+    lineDashOffset: 0
+    font: "10px sans-serif"
+    textAlign: "start"
+    textBaseline: "alphabetic"
+    direction: "ltr"
+    strokeStyle: "#000000"
+    fillStyle: "#000000"
+    imageSmoothingEnabled: true
+    imageSmoothingQuality: "low"
+    setPath: [""]
+  parameters:
+  content: <filtered>
+frames:
+  0: (duration)
+    0: arc(1, 2, 3, 4, 5, false)
+      swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
+      trace:
+        0: arc
+        1: (anonymous function)
+        2: ignoreException
+        3: (anonymous function)
+        4: executeFrameFunction
+        5: performActions
+        6: Global Code
+        7: evaluateWithScopeExtension
+        8: (anonymous function)
+        9: _wrapCall
+    1: arc(6, 7, 8, 9, 10, true)
+      swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
+      trace:
+        0: arc
+        1: (anonymous function)
+        2: ignoreException
+        3: (anonymous function)
+        4: executeFrameFunction
+        5: performActions
+        6: Global Code
+        7: evaluateWithScopeExtension
+        8: (anonymous function)
+        9: _wrapCall
+
diff --git a/LayoutTests/inspector/canvas/recording-2d-frameCount.html b/LayoutTests/inspector/canvas/recording-2d-frameCount.html
new file mode 100644 (file)
index 0000000..1319def
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-2d.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recording2D");
+
+    suite.addTestCase({
+        name: "Canvas.recording2D.singleFrame",
+        description: "Check that the recording is stopped after a single frame.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject, {frameCount: 1});
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to 2D canvas contexts.</p>
+</body>
+</html>
@@ -2,65 +2,6 @@ Test that CanvasManager is able to record actions made to 2D canvas contexts.
 
 
 == Running test suite: Canvas.recording2D
--- Running test case: Canvas.recording2D.singleFrame
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  current state:
-    setTransform: [[1,0,0,1,0,0]]
-    globalAlpha: 1
-    globalCompositeOperation: "source-over"
-    lineWidth: 1
-    lineCap: "butt"
-    lineJoin: "miter"
-    miterLimit: 10
-    shadowOffsetX: 0
-    shadowOffsetY: 0
-    shadowBlur: 0
-    shadowColor: "rgba(0, 0, 0, 0)"
-    setLineDash: [[]]
-    lineDashOffset: 0
-    font: "10px sans-serif"
-    textAlign: "start"
-    textBaseline: "alphabetic"
-    direction: "ltr"
-    strokeStyle: "#000000"
-    fillStyle: "#000000"
-    imageSmoothingEnabled: true
-    imageSmoothingQuality: "low"
-    setPath: [""]
-  parameters:
-  content: <filtered>
-frames:
-  0: (duration)
-    0: arc(1, 2, 3, 4, 5, false)
-      swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
-      trace:
-        0: arc
-        1: (anonymous function)
-        2: ignoreException
-        3: (anonymous function)
-        4: executeFrameFunction
-        5: performActions
-        6: Global Code
-        7: evaluateWithScopeExtension
-        8: (anonymous function)
-        9: _wrapCall
-    1: arc(6, 7, 8, 9, 10, true)
-      swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
-      trace:
-        0: arc
-        1: (anonymous function)
-        2: ignoreException
-        3: (anonymous function)
-        4: executeFrameFunction
-        5: performActions
-        6: Global Code
-        7: evaluateWithScopeExtension
-        8: (anonymous function)
-        9: _wrapCall
-
 -- Running test case: Canvas.recording2D.multipleFrames
 initialState:
   attributes:
@@ -1088,71 +1029,3 @@ frames:
         0: (anonymous function)
         1: executeFrameFunction
 
--- Running test case: Canvas.recording2D.memoryLimit
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  current state:
-    setTransform: [[1,0,0,1,0,0]]
-    globalAlpha: 1
-    globalCompositeOperation: "source-over"
-    lineWidth: 1
-    lineCap: "butt"
-    lineJoin: "miter"
-    miterLimit: 10
-    shadowOffsetX: 0
-    shadowOffsetY: 0
-    shadowBlur: 0
-    shadowColor: "rgba(0, 0, 0, 0)"
-    setLineDash: [[]]
-    lineDashOffset: 0
-    font: "10px sans-serif"
-    textAlign: "start"
-    textBaseline: "alphabetic"
-    direction: "ltr"
-    strokeStyle: "#000000"
-    fillStyle: "#000000"
-    imageSmoothingEnabled: true
-    imageSmoothingQuality: "low"
-    setPath: [""]
-  parameters:
-  content: <filtered>
-frames:
-  0: (duration) (incomplete)
-    0: arc(1, 2, 3, 4, 5, false)
-      swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
-      trace:
-        0: arc
-        1: (anonymous function)
-        2: ignoreException
-        3: (anonymous function)
-        4: executeFrameFunction
-        5: performActions
-        6: Global Code
-        7: evaluateWithScopeExtension
-        8: (anonymous function)
-        9: _wrapCall
-
--- Running test case: Canvas.recording2D.Console
-PASS: The recording should have the name "TEST".
-PASS: The recording should have one frame.
-PASS: The first frame should have one action.
-
--- Running test case: Canvas.recording2D.ActionParameterNaN
-PASS: The recording should have 1 frame.
-PASS: The first frame should have 1 action.
-PASS: The action should have 1 parameter.
-PASS: The parameter should be null.
-
--- Running test case: Canvas.recording2D.ExistingSaves
-PASS: There should be 4 existing states.
-PASS: State 0 should match expected fillStyle value.
-PASS: State 1 should match expected fillStyle value.
-PASS: State 2 should match expected fillStyle value.
-PASS: State 3 should match expected fillStyle value.
-
--- Running test case: Canvas.recording2D.NoActions
-PASS: A recording should have been started and stopped once.
-PASS: A recording should have been started and stopped twice.
-
diff --git a/LayoutTests/inspector/canvas/recording-2d-full.html b/LayoutTests/inspector/canvas/recording-2d-full.html
new file mode 100644 (file)
index 0000000..4230f54
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-2d.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recording2D");
+
+    suite.addTestCase({
+        name: "Canvas.recording2D.multipleFrames",
+        description: "Check that recording data is serialized correctly for multiple frames.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject);
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to 2D canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt b/LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt
new file mode 100644 (file)
index 0000000..854b0e4
--- /dev/null
@@ -0,0 +1,50 @@
+Test that CanvasManager is able to record actions made to 2D canvas contexts.
+
+
+== Running test suite: Canvas.recording2D
+-- Running test case: Canvas.recording2D.memoryLimit
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  current state:
+    setTransform: [[1,0,0,1,0,0]]
+    globalAlpha: 1
+    globalCompositeOperation: "source-over"
+    lineWidth: 1
+    lineCap: "butt"
+    lineJoin: "miter"
+    miterLimit: 10
+    shadowOffsetX: 0
+    shadowOffsetY: 0
+    shadowBlur: 0
+    shadowColor: "rgba(0, 0, 0, 0)"
+    setLineDash: [[]]
+    lineDashOffset: 0
+    font: "10px sans-serif"
+    textAlign: "start"
+    textBaseline: "alphabetic"
+    direction: "ltr"
+    strokeStyle: "#000000"
+    fillStyle: "#000000"
+    imageSmoothingEnabled: true
+    imageSmoothingQuality: "low"
+    setPath: [""]
+  parameters:
+  content: <filtered>
+frames:
+  0: (duration) (incomplete)
+    0: arc(1, 2, 3, 4, 5, false)
+      swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
+      trace:
+        0: arc
+        1: (anonymous function)
+        2: ignoreException
+        3: (anonymous function)
+        4: executeFrameFunction
+        5: performActions
+        6: Global Code
+        7: evaluateWithScopeExtension
+        8: (anonymous function)
+        9: _wrapCall
+
diff --git a/LayoutTests/inspector/canvas/recording-2d-memoryLimit.html b/LayoutTests/inspector/canvas/recording-2d-memoryLimit.html
new file mode 100644 (file)
index 0000000..af4cf94
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-2d.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recording2D");
+
+    suite.addTestCase({
+        name: "Canvas.recording2D.memoryLimit",
+        description: "Check that the recording is stopped when it reaches the memory limit.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject, {memoryLimit: 10});
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to 2D canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-2d-saves-expected.txt b/LayoutTests/inspector/canvas/recording-2d-saves-expected.txt
new file mode 100644 (file)
index 0000000..4c1a181
--- /dev/null
@@ -0,0 +1,11 @@
+Test that CanvasManager is able to record actions made to 2D canvas contexts.
+
+
+== Running test suite: Canvas.recording2D
+-- Running test case: Canvas.recording2D.ExistingSaves
+PASS: There should be 4 existing states.
+PASS: State 0 should match expected fillStyle value.
+PASS: State 1 should match expected fillStyle value.
+PASS: State 2 should match expected fillStyle value.
+PASS: State 3 should match expected fillStyle value.
+
diff --git a/LayoutTests/inspector/canvas/recording-2d-saves.html b/LayoutTests/inspector/canvas/recording-2d-saves.html
new file mode 100644 (file)
index 0000000..9b78fdd
--- /dev/null
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-2d.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recording2D");
+
+    suite.addTestCase({
+        name: "Canvas.recording2D.ExistingSaves",
+        description: "Check that existing save calls are sent to the frontend.",
+        test(resolve, reject) {
+            let canvas = getCanvas(WI.Canvas.ContextType.Canvas2D);
+            if (!canvas) {
+                reject("Missing 2D canvas.");
+                return;
+            }
+
+            async function logStates(recording) {
+                async function compare(index, expected) {
+                    let state = await WI.RecordingState.swizzleInitialState(recording, recording.initialState.states[index]);
+                    InspectorTest.expectEqual(state.get("fillStyle"), expected, `State ${index} should match expected fillStyle value.`)
+                }
+
+                await compare(0, "#000000");
+                await compare(1, "#ff0000");
+                await compare(2, "#00ff00");
+                await compare(3, "#0000ff");
+            }
+
+            canvas.awaitEvent(WI.Canvas.Event.RecordingStopped)
+            .then((event) => {
+                let {recording} = event.data;
+
+                InspectorTest.expectEqual(recording.initialState.states.length, 4, "There should be 4 existing states.");
+
+                logStates(recording)
+                .then(resolve, reject);
+            });
+
+            canvas.awaitEvent(WI.Canvas.Event.RecordingStarted)
+            .then((event) => {
+                InspectorTest.evaluateInPage(`performSavePostActions()`).catch(reject);
+            });
+
+            InspectorTest.evaluateInPage(`performSavePreActions()`)
+            .then(() => {
+                const frameCount = 1;
+                CanvasAgent.startRecording(canvas.identifier, frameCount).catch(reject);
+            }, reject);
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to 2D canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-bitmaprenderer-expected.txt b/LayoutTests/inspector/canvas/recording-bitmaprenderer-expected.txt
deleted file mode 100644 (file)
index ffece3e..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.
-
-
-== Running test suite: Canvas.recordingBitmapRenderer
--- Running test case: Canvas.recordingBitmapRenderer.singleFrame
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  parameters:
-  content: <filtered>
-frames:
-  0: (duration)
-    0: transferFromImageBitmap([object ImageBitmap])
-      swizzleTypes: [ImageBitmap]
-      trace:
-        0: transferFromImageBitmap
-        1: (anonymous function)
-        2: executeFrameFunction
-        3: (anonymous function)
-        4: asyncFunctionResume
-        5: (anonymous function)
-        6: promiseReactionJob
-      snapshot: <filtered>
-
--- Running test case: Canvas.recordingBitmapRenderer.multipleFrames
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  parameters:
-  content: <filtered>
-frames:
-  0: (duration)
-    0: transferFromImageBitmap([object ImageBitmap])
-      swizzleTypes: [ImageBitmap]
-      trace:
-        0: transferFromImageBitmap
-        1: (anonymous function)
-        2: executeFrameFunction
-        3: (anonymous function)
-        4: asyncFunctionResume
-        5: (anonymous function)
-        6: promiseReactionJob
-      snapshot: <filtered>
-  1: (duration)
-    0: width
-      trace:
-        0: (anonymous function)
-        1: executeFrameFunction
-    1: width = 2
-      swizzleTypes: [Number]
-      trace:
-        0: (anonymous function)
-        1: executeFrameFunction
-  2: (duration)
-    0: height
-      trace:
-        0: (anonymous function)
-        1: executeFrameFunction
-    1: height = 2
-      swizzleTypes: [Number]
-      trace:
-        0: (anonymous function)
-        1: executeFrameFunction
-
--- Running test case: Canvas.recordingBitmapRenderer.memoryLimit
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  parameters:
-  content: <filtered>
-frames:
-  0: (duration) (incomplete)
-    0: transferFromImageBitmap([object ImageBitmap])
-      swizzleTypes: [ImageBitmap]
-      trace:
-        0: transferFromImageBitmap
-        1: (anonymous function)
-        2: executeFrameFunction
-        3: (anonymous function)
-        4: asyncFunctionResume
-        5: (anonymous function)
-        6: promiseReactionJob
-      snapshot: <filtered>
-
--- Running test case: Canvas.recordingBitmapRenderer.Console
-PASS: The recording should have the name "TEST".
-PASS: The recording should have one frame.
-PASS: The first frame should have one action.
-
diff --git a/LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt b/LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount-expected.txt
new file mode 100644 (file)
index 0000000..0301131
--- /dev/null
@@ -0,0 +1,25 @@
+Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.
+
+
+== Running test suite: Canvas.recordingBitmapRenderer
+-- Running test case: Canvas.recordingBitmapRenderer.singleFrame
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  parameters:
+  content: <filtered>
+frames:
+  0: (duration)
+    0: transferFromImageBitmap([object ImageBitmap])
+      swizzleTypes: [ImageBitmap]
+      trace:
+        0: transferFromImageBitmap
+        1: (anonymous function)
+        2: executeFrameFunction
+        3: (anonymous function)
+        4: asyncFunctionResume
+        5: (anonymous function)
+        6: promiseReactionJob
+      snapshot: <filtered>
+
diff --git a/LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount.html b/LayoutTests/inspector/canvas/recording-bitmaprenderer-frameCount.html
new file mode 100644 (file)
index 0000000..7a4de9c
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-bitmaprenderer.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingBitmapRenderer");
+
+    suite.addTestCase({
+        name: "Canvas.recordingBitmapRenderer.singleFrame",
+        description: "Check that the recording is stopped after a single frame.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject, {frameCount: 1});
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-bitmaprenderer-full-expected.txt b/LayoutTests/inspector/canvas/recording-bitmaprenderer-full-expected.txt
new file mode 100644 (file)
index 0000000..46b1a0d
--- /dev/null
@@ -0,0 +1,45 @@
+Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.
+
+
+== Running test suite: Canvas.recordingBitmapRenderer
+-- Running test case: Canvas.recordingBitmapRenderer.multipleFrames
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  parameters:
+  content: <filtered>
+frames:
+  0: (duration)
+    0: transferFromImageBitmap([object ImageBitmap])
+      swizzleTypes: [ImageBitmap]
+      trace:
+        0: transferFromImageBitmap
+        1: (anonymous function)
+        2: executeFrameFunction
+        3: (anonymous function)
+        4: asyncFunctionResume
+        5: (anonymous function)
+        6: promiseReactionJob
+      snapshot: <filtered>
+  1: (duration)
+    0: width
+      trace:
+        0: (anonymous function)
+        1: executeFrameFunction
+    1: width = 2
+      swizzleTypes: [Number]
+      trace:
+        0: (anonymous function)
+        1: executeFrameFunction
+  2: (duration)
+    0: height
+      trace:
+        0: (anonymous function)
+        1: executeFrameFunction
+    1: height = 2
+      swizzleTypes: [Number]
+      trace:
+        0: (anonymous function)
+        1: executeFrameFunction
+
diff --git a/LayoutTests/inspector/canvas/recording-bitmaprenderer-full.html b/LayoutTests/inspector/canvas/recording-bitmaprenderer-full.html
new file mode 100644 (file)
index 0000000..82a6b67
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-bitmaprenderer.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingBitmapRenderer");
+
+    suite.addTestCase({
+        name: "Canvas.recordingBitmapRenderer.multipleFrames",
+        description: "Check that recording data is serialized correctly for multiple frames.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject);
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt b/LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit-expected.txt
new file mode 100644 (file)
index 0000000..412eaff
--- /dev/null
@@ -0,0 +1,25 @@
+Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.
+
+
+== Running test suite: Canvas.recordingBitmapRenderer
+-- Running test case: Canvas.recordingBitmapRenderer.memoryLimit
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  parameters:
+  content: <filtered>
+frames:
+  0: (duration) (incomplete)
+    0: transferFromImageBitmap([object ImageBitmap])
+      swizzleTypes: [ImageBitmap]
+      trace:
+        0: transferFromImageBitmap
+        1: (anonymous function)
+        2: executeFrameFunction
+        3: (anonymous function)
+        4: asyncFunctionResume
+        5: (anonymous function)
+        6: promiseReactionJob
+      snapshot: <filtered>
+
diff --git a/LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit.html b/LayoutTests/inspector/canvas/recording-bitmaprenderer-memoryLimit.html
new file mode 100644 (file)
index 0000000..4c59efc
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/recording-bitmaprenderer.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingBitmapRenderer");
+
+    suite.addTestCase({
+        name: "Canvas.recordingBitmapRenderer.memoryLimit",
+        description: "Check that the recording is stopped when it reaches the memory limit.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject, {memoryLimit: 10});
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.</p>
+</body>
+</html>
index 9e76eb5..81431f7 100644 (file)
@@ -2,7 +2,13 @@ Test general cases of CanvasAgent recording calls.
 
 
 == Running test suite: Canvas.recording
--- Running test case: Canvas.multipleRecording
+-- Running test case: Canvas.ActionParameterNaN
+PASS: The recording should have 1 frame.
+PASS: The first frame should have 1 action.
+PASS: The action should have 1 parameter.
+PASS: The parameter should be null.
+
+-- Running test case: Canvas.MultipleRecording
 Starting a recording of canvas 1...
 PASS: Recording started of canvas 1
 Starting a recording of canvas 2...
@@ -14,6 +20,10 @@ PASS: There should be a recording for canvas 1.
 Stopping the recording of canvas 2...
 PASS: There should be a recording for canvas 2.
 
+-- Running test case: Canvas.NoActions
+PASS: A recording should have been started and stopped once.
+PASS: A recording should have been started and stopped twice.
+
 -- Running test case: Canvas.startRecording.InvalidCanvasId
 PASS: Should produce an error.
 Error: No canvas for given identifier.
diff --git a/LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt b/LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt
new file mode 100644 (file)
index 0000000..9a2ce06
--- /dev/null
@@ -0,0 +1,26 @@
+Test that CanvasManager is able to record actions made to WebGL canvas contexts.
+
+
+== Running test suite: Canvas.recordingWebGL
+-- Running test case: Canvas.recordingWebGL.singleFrame
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  parameters:
+    0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
+  content: <filtered>
+frames:
+  0: (duration)
+    0: activeTexture(1)
+      swizzleTypes: [Number]
+      trace:
+        0: activeTexture
+        1: (anonymous function)
+        2: executeFrameFunction
+        3: performActions
+        4: Global Code
+        5: evaluateWithScopeExtension
+        6: (anonymous function)
+        7: _wrapCall
+
diff --git a/LayoutTests/inspector/canvas/recording-webgl-frameCount.html b/LayoutTests/inspector/canvas/recording-webgl-frameCount.html
new file mode 100644 (file)
index 0000000..f240276
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL.singleFrame",
+        description: "Check that the recording is stopped after a single frame.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.WebGL, resolve, reject, {frameCount: 1});
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL canvas contexts.</p>
+</body>
+</html>
@@ -2,28 +2,6 @@ Test that CanvasManager is able to record actions made to WebGL canvas contexts.
 
 
 == Running test suite: Canvas.recordingWebGL
--- Running test case: Canvas.recordingWebGL.singleFrame
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  parameters:
-    0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
-  content: <filtered>
-frames:
-  0: (duration)
-    0: activeTexture(1)
-      swizzleTypes: [Number]
-      trace:
-        0: activeTexture
-        1: (anonymous function)
-        2: executeFrameFunction
-        3: performActions
-        4: Global Code
-        5: evaluateWithScopeExtension
-        6: (anonymous function)
-        7: _wrapCall
-
 -- Running test case: Canvas.recordingWebGL.multipleFrames
 initialState:
   attributes:
@@ -1027,30 +1005,3 @@ frames:
         0: (anonymous function)
         1: executeFrameFunction
 
--- Running test case: Canvas.recordingWebGL.memoryLimit
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  parameters:
-    0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
-  content: <filtered>
-frames:
-  0: (duration) (incomplete)
-    0: activeTexture(1)
-      swizzleTypes: [Number]
-      trace:
-        0: activeTexture
-        1: (anonymous function)
-        2: executeFrameFunction
-        3: performActions
-        4: Global Code
-        5: evaluateWithScopeExtension
-        6: (anonymous function)
-        7: _wrapCall
-
--- Running test case: Canvas.recordingWebGL.Console
-PASS: The recording should have the name "TEST".
-PASS: The recording should have one frame.
-PASS: The first frame should have one action.
-
diff --git a/LayoutTests/inspector/canvas/recording-webgl-full.html b/LayoutTests/inspector/canvas/recording-webgl-full.html
new file mode 100644 (file)
index 0000000..c74361b
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL.multipleFrames",
+        description: "Check that recording data is serialized correctly for multiple frames.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.WebGL, resolve, reject);
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt b/LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt
new file mode 100644 (file)
index 0000000..72784fc
--- /dev/null
@@ -0,0 +1,26 @@
+Test that CanvasManager is able to record actions made to WebGL canvas contexts.
+
+
+== Running test suite: Canvas.recordingWebGL
+-- Running test case: Canvas.recordingWebGL.memoryLimit
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  parameters:
+    0: {"alpha":true,"depth":true,"stencil":false,"antialias":true,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
+  content: <filtered>
+frames:
+  0: (duration) (incomplete)
+    0: activeTexture(1)
+      swizzleTypes: [Number]
+      trace:
+        0: activeTexture
+        1: (anonymous function)
+        2: executeFrameFunction
+        3: performActions
+        4: Global Code
+        5: evaluateWithScopeExtension
+        6: (anonymous function)
+        7: _wrapCall
+
diff --git a/LayoutTests/inspector/canvas/recording-webgl-memoryLimit.html b/LayoutTests/inspector/canvas/recording-webgl-memoryLimit.html
new file mode 100644 (file)
index 0000000..64bff31
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL.memoryLimit",
+        description: "Check that the recording is stopped when it reaches the memory limit.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.WebGL, resolve, reject, {memoryLimit: 10});
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt b/LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt
new file mode 100644 (file)
index 0000000..29bf6d1
--- /dev/null
@@ -0,0 +1,26 @@
+Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.
+
+
+== Running test suite: Canvas.recordingWebGL2
+-- Running test case: Canvas.recordingWebGL2.singleFrame
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  parameters:
+    0: {"alpha":true,"depth":true,"stencil":false,"antialias":false,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
+  content: <filtered>
+frames:
+  0: (duration)
+    0: activeTexture(1)
+      swizzleTypes: [Number]
+      trace:
+        0: activeTexture
+        1: (anonymous function)
+        2: executeFrameFunction
+        3: performActions
+        4: Global Code
+        5: evaluateWithScopeExtension
+        6: (anonymous function)
+        7: _wrapCall
+
diff --git a/LayoutTests/inspector/canvas/recording-webgl2-frameCount.html b/LayoutTests/inspector/canvas/recording-webgl2-frameCount.html
new file mode 100644 (file)
index 0000000..4ca7c1d
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl2.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL2");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL2.singleFrame",
+        description: "Check that the recording is stopped after a single frame.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject, {frameCount: 1});
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.</p>
+</body>
+</html>
@@ -2,28 +2,6 @@ Test that CanvasManager is able to record actions made to WebGL2 canvas contexts
 
 
 == Running test suite: Canvas.recordingWebGL2
--- Running test case: Canvas.recordingWebGL2.singleFrame
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  parameters:
-    0: {"alpha":true,"depth":true,"stencil":false,"antialias":false,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
-  content: <filtered>
-frames:
-  0: (duration)
-    0: activeTexture(1)
-      swizzleTypes: [Number]
-      trace:
-        0: activeTexture
-        1: (anonymous function)
-        2: executeFrameFunction
-        3: performActions
-        4: Global Code
-        5: evaluateWithScopeExtension
-        6: (anonymous function)
-        7: _wrapCall
-
 -- Running test case: Canvas.recordingWebGL2.multipleFrames
 initialState:
   attributes:
@@ -994,30 +972,3 @@ frames:
         0: (anonymous function)
         1: executeFrameFunction
 
--- Running test case: Canvas.recordingWebGL2.memoryLimit
-initialState:
-  attributes:
-    width: 2
-    height: 2
-  parameters:
-    0: {"alpha":true,"depth":true,"stencil":false,"antialias":false,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
-  content: <filtered>
-frames:
-  0: (duration) (incomplete)
-    0: activeTexture(1)
-      swizzleTypes: [Number]
-      trace:
-        0: activeTexture
-        1: (anonymous function)
-        2: executeFrameFunction
-        3: performActions
-        4: Global Code
-        5: evaluateWithScopeExtension
-        6: (anonymous function)
-        7: _wrapCall
-
--- Running test case: Canvas.recordingWebGL2.Console
-PASS: The recording should have the name "TEST".
-PASS: The recording should have one frame.
-PASS: The first frame should have one action.
-
diff --git a/LayoutTests/inspector/canvas/recording-webgl2-full.html b/LayoutTests/inspector/canvas/recording-webgl2-full.html
new file mode 100644 (file)
index 0000000..ba68e17
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl2.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL2");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL2.multipleFrames",
+        description: "Check that recording data is serialized correctly for multiple frames.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject);
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt b/LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt
new file mode 100644 (file)
index 0000000..2c9d9de
--- /dev/null
@@ -0,0 +1,26 @@
+Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.
+
+
+== Running test suite: Canvas.recordingWebGL2
+-- Running test case: Canvas.recordingWebGL2.memoryLimit
+initialState:
+  attributes:
+    width: 2
+    height: 2
+  parameters:
+    0: {"alpha":true,"depth":true,"stencil":false,"antialias":false,"premultipliedAlpha":true,"preserveDrawingBuffer":false,"failIfMajorPerformanceCaveat":false}
+  content: <filtered>
+frames:
+  0: (duration) (incomplete)
+    0: activeTexture(1)
+      swizzleTypes: [Number]
+      trace:
+        0: activeTexture
+        1: (anonymous function)
+        2: executeFrameFunction
+        3: performActions
+        4: Global Code
+        5: evaluateWithScopeExtension
+        6: (anonymous function)
+        7: _wrapCall
+
diff --git a/LayoutTests/inspector/canvas/recording-webgl2-memoryLimit.html b/LayoutTests/inspector/canvas/recording-webgl2-memoryLimit.html
new file mode 100644 (file)
index 0000000..0174b0a
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="resources/recording-utilities.js"></script>
+<script src="resources/shaderProgram-utilities.js"></script>
+<script id="vertex-shader" type="x-shader/x-vertex">
+    attribute vec4 test;
+    void main(void) {
+        gl_Position = test;
+    }
+</script>
+<script id="fragment-shader" type="x-shader/x-fragment">
+    precision mediump float;
+
+    void main(void) {
+        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+    }
+</script>
+<script src="resources/recording-webgl2.js"></script>
+<script>
+function test() {
+    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL2");
+
+    suite.addTestCase({
+        name: "Canvas.recordingWebGL2.memoryLimit",
+        description: "Check that the recording is stopped when it reaches the memory limit.",
+        test(resolve, reject) {
+            startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject, {memoryLimit: 10});
+        },
+        timeout: -1,
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="load()">
+    <p>Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.</p>
+</body>
+</html>
index 9dc73eb..25c6fbc 100644 (file)
@@ -6,18 +6,54 @@
 let contextA = document.createElement("canvas").getContext("2d");
 let contextB = document.createElement("canvas").getContext("2d");
 
-function performActions() {
+function performActionsNaN() {
+    contextA.globalAlpha = NaN;
+}
+
+function performActionsMultiple() {
     contextA.fill();
     contextB.fill();
 
-    TestPage.dispatchEventToFrontend("TestPage-performActions");
+    TestPage.dispatchEventToFrontend("TestPage-performActionsMultiple");
 }
 
 function test() {
     let suite = InspectorTest.createAsyncSuite("Canvas.recording");
 
     suite.addTestCase({
-        name: "Canvas.multipleRecording",
+        name: "Canvas.ActionParameterNaN",
+        description: "Check that NaN is converted into the proper value for serialization.",
+        test(resolve, reject) {
+            let canvas = WI.canvasManager.canvases[0];
+            InspectorTest.assert(canvas, "There should be at least one canvas context.");
+
+            canvas.awaitEvent(WI.Canvas.Event.RecordingStopped)
+            .then((event) => {
+                let recording = event.data.recording.toJSON();
+
+                let frames = recording.frames;
+                InspectorTest.expectEqual(frames.length, 1, "The recording should have 1 frame.");
+
+                let actions = frames[0].actions;
+                InspectorTest.expectEqual(actions.length, 1, "The first frame should have 1 action.");
+                InspectorTest.expectEqual(actions[0][1].length, 1, "The action should have 1 parameter.");
+                InspectorTest.expectEqual(actions[0][1][0], null, "The parameter should be null.");
+            })
+            .then(resolve, reject);
+
+            canvas.awaitEvent(WI.Canvas.Event.RecordingStarted)
+            .then((event) => {
+                InspectorTest.evaluateInPage(`performActionsNaN()`);
+            });
+
+            const frameCount = 1;
+            CanvasAgent.startRecording(canvas.identifier, frameCount)
+            .catch(reject);
+        },
+    });
+
+    suite.addTestCase({
+        name: "Canvas.MultipleRecording",
         description: "Check that multiple recordings are able to be started/stopped at the same time.",
         test(resolve, reject) {
             const singleFrame = false;
@@ -39,7 +75,7 @@ function test() {
                 canvases[1].stopRecording();
             });
 
-            InspectorTest.awaitEvent("TestPage-performActions")
+            InspectorTest.awaitEvent("TestPage-performActionsMultiple")
             .then((event) => {
                 InspectorTest.pass("Actions performed.");
 
@@ -52,7 +88,7 @@ function test() {
                 InspectorTest.expectThat(canvases[1].recordingActive, "Recording started of canvas 2");
 
                 InspectorTest.log("Performing actions...");
-                InspectorTest.evaluateInPage(`performActions()`);
+                InspectorTest.evaluateInPage(`performActionsMultiple()`);
             });
 
             canvases[0].awaitEvent(WI.Canvas.Event.RecordingStarted)
@@ -69,6 +105,37 @@ function test() {
     });
 
     suite.addTestCase({
+        name: "Canvas.NoActions",
+        description: "Check that a canvas is still able to be recorded after stopping a recording with no actions.",
+        test(resolve, reject) {
+            let canvas = WI.canvasManager.canvases[0];
+            InspectorTest.assert(canvas, "There should be at least one canvas context.");
+
+            let eventCount = 0;
+            function handleRecordingStopped(event) {
+                InspectorTest.assert(!event.data.recording, "The recording payload should be null.");
+
+                ++eventCount;
+                if (eventCount == 1) {
+                    InspectorTest.pass("A recording should have been started and stopped once.");
+
+                    canvas.startRecording();
+                    canvas.stopRecording();
+                } else if (eventCount >= 2) {
+                    InspectorTest.pass("A recording should have been started and stopped twice.");
+
+                    canvas.removeEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
+                    resolve();
+                }
+            }
+            canvas.addEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
+
+            canvas.startRecording();
+            canvas.stopRecording();
+        },
+    });
+
+    suite.addTestCase({
         name: "Canvas.startRecording.InvalidCanvasId",
         description: "Invalid canvas identifiers should cause an error.",
         test(resolve, reject) {
@@ -1,9 +1,3 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script src="resources/recording-utilities.js"></script>
-<script>
 let ctx = null;
 
 // 2x2 red square
@@ -430,168 +424,3 @@ function performSavePreActions() {
 function performSavePostActions() {
     ctx.fill();
 }
-
-function performNaNActions() {
-    ctx.globalAlpha = NaN;
-}
-
-function test() {
-    let suite = InspectorTest.createAsyncSuite("Canvas.recording2D");
-
-    suite.addTestCase({
-        name: "Canvas.recording2D.singleFrame",
-        description: "Check that the recording is stopped after a single frame.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject, {frameCount: 1});
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recording2D.multipleFrames",
-        description: "Check that recording data is serialized correctly for multiple frames.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject);
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recording2D.memoryLimit",
-        description: "Check that the recording is stopped when it reaches the memory limit.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.Canvas2D, resolve, reject, {memoryLimit: 10});
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recording2D.Console",
-        description: "Check that a recording can be triggered by console.record().",
-        test(resolve, reject) {
-            consoleRecord(WI.Canvas.ContextType.Canvas2D, resolve, reject);
-        },
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recording2D.ActionParameterNaN",
-        description: "Check that NaN is converted into the proper value for serialization.",
-        test(resolve, reject) {
-            let canvas = getCanvas(WI.Canvas.ContextType.Canvas2D);
-            if (!canvas) {
-                reject("Missing 2D canvas.");
-                return;
-            }
-
-            canvas.awaitEvent(WI.Canvas.Event.RecordingStopped)
-            .then((event) => {
-                let recording = event.data.recording.toJSON();
-
-                let frames = recording.frames;
-                InspectorTest.expectEqual(frames.length, 1, "The recording should have 1 frame.");
-
-                let actions = frames[0].actions;
-                InspectorTest.expectEqual(actions.length, 1, "The first frame should have 1 action.");
-                InspectorTest.expectEqual(actions[0][1].length, 1, "The action should have 1 parameter.");
-                InspectorTest.expectEqual(actions[0][1][0], null, "The parameter should be null.");
-            })
-            .then(resolve, reject);
-
-            canvas.awaitEvent(WI.Canvas.Event.RecordingStarted)
-            .then((event) => {
-                InspectorTest.evaluateInPage(`performNaNActions()`);
-            });
-
-            const frameCount = 1;
-            CanvasAgent.startRecording(canvas.identifier, frameCount)
-            .catch(reject);
-        },
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recording2D.ExistingSaves",
-        description: "Check that existing save calls are sent to the frontend.",
-        test(resolve, reject) {
-            let canvas = getCanvas(WI.Canvas.ContextType.Canvas2D);
-            if (!canvas) {
-                reject("Missing 2D canvas.");
-                return;
-            }
-
-            async function logStates(recording) {
-                async function compare(index, expected) {
-                    let state = await WI.RecordingState.swizzleInitialState(recording, recording.initialState.states[index]);
-                    InspectorTest.expectEqual(state.get("fillStyle"), expected, `State ${index} should match expected fillStyle value.`)
-                }
-
-                await compare(0, "#000000");
-                await compare(1, "#ff0000");
-                await compare(2, "#00ff00");
-                await compare(3, "#0000ff");
-            }
-
-            canvas.awaitEvent(WI.Canvas.Event.RecordingStopped)
-            .then((event) => {
-                let {recording} = event.data;
-
-                InspectorTest.expectEqual(recording.initialState.states.length, 4, "There should be 4 existing states.");
-
-                logStates(recording)
-                .then(resolve, reject);
-            });
-
-            canvas.awaitEvent(WI.Canvas.Event.RecordingStarted)
-            .then((event) => {
-                InspectorTest.evaluateInPage(`performSavePostActions()`).catch(reject);
-            });
-
-            InspectorTest.evaluateInPage(`performSavePreActions()`)
-            .then(() => {
-                const frameCount = 1;
-                CanvasAgent.startRecording(canvas.identifier, frameCount).catch(reject);
-            }, reject);
-        },
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recording2D.NoActions",
-        description: "Check that a canvas is still able to be recorded after stopping a recording with no actions.",
-        test(resolve, reject) {
-            let canvas = getCanvas(WI.Canvas.ContextType.Canvas2D);
-            if (!canvas) {
-                reject("Missing 2D canvas.");
-                return;
-            }
-
-            let eventCount = 0;
-            function handleRecordingStopped(event) {
-                InspectorTest.assert(!event.data.recording, "The recording payload should be null.");
-
-                ++eventCount;
-                if (eventCount == 1) {
-                    InspectorTest.pass("A recording should have been started and stopped once.");
-
-                    canvas.startRecording();
-                    canvas.stopRecording();
-                } else if (eventCount >= 2) {
-                    InspectorTest.pass("A recording should have been started and stopped twice.");
-
-                    canvas.removeEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
-                    resolve();
-                }
-            }
-            canvas.addEventListener(WI.Canvas.Event.RecordingStopped, handleRecordingStopped);
-
-            canvas.startRecording();
-            canvas.stopRecording();
-        },
-    });
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body onload="load()">
-    <p>Test that CanvasManager is able to record actions made to 2D canvas contexts.</p>
-</body>
-</html>
@@ -1,9 +1,3 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script src="resources/recording-utilities.js"></script>
-<script>
 let ctx = null;
 
 let redImage = new Image;
@@ -87,47 +81,3 @@ async function performConsoleActions() {
 
     ctx.transferFromImageBitmap(blueBitmap);
 }
-
-function test() {
-    let suite = InspectorTest.createAsyncSuite("Canvas.recordingBitmapRenderer");
-
-    suite.addTestCase({
-        name: "Canvas.recordingBitmapRenderer.singleFrame",
-        description: "Check that the recording is stopped after a single frame.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject, {frameCount: 1});
-        },
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingBitmapRenderer.multipleFrames",
-        description: "Check that recording data is serialized correctly for multiple frames.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject);
-        },
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingBitmapRenderer.memoryLimit",
-        description: "Check that the recording is stopped when it reaches the memory limit.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.BitmapRenderer, resolve, reject, {memoryLimit: 10});
-        },
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingBitmapRenderer.Console",
-        description: "Check that a recording can be triggered by console.record().",
-        test(resolve, reject) {
-            consoleRecord(WI.Canvas.ContextType.BitmapRenderer, resolve, reject);
-        },
-    });
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body onload="load()">
-    <p>Test that CanvasManager is able to record actions made to BitmapRenderer canvas contexts.</p>
-</body>
-</html>
@@ -1,23 +1,3 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script src="resources/recording-utilities.js"></script>
-<script src="resources/shaderProgram-utilities.js"></script>
-<script id="vertex-shader" type="x-shader/x-vertex">
-    attribute vec4 test;
-    void main(void) {
-        gl_Position = test;
-    }
-</script>
-<script id="fragment-shader" type="x-shader/x-fragment">
-    precision mediump float;
-
-    void main(void) {
-        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
-    }
-</script>
-<script>
 if (window.internals)
     window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
 
@@ -516,50 +496,3 @@ function performConsoleActions() {
 
     context.createBuffer();
 }
-
-function test() {
-    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL");
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL.singleFrame",
-        description: "Check that the recording is stopped after a single frame.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.WebGL, resolve, reject, {frameCount: 1});
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL.multipleFrames",
-        description: "Check that recording data is serialized correctly for multiple frames.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.WebGL, resolve, reject);
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL.memoryLimit",
-        description: "Check that the recording is stopped when it reaches the memory limit.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.WebGL, resolve, reject, {memoryLimit: 10});
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL.Console",
-        description: "Check that a recording can be triggered by console.record().",
-        test(resolve, reject) {
-            consoleRecord(WI.Canvas.ContextType.WebGL, resolve, reject);
-        },
-    });
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body onload="load()">
-    <p>Test that CanvasManager is able to record actions made to WebGL canvas contexts.</p>
-</body>
-</html>
@@ -1,23 +1,3 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
-<script src="resources/recording-utilities.js"></script>
-<script src="resources/shaderProgram-utilities.js"></script>
-<script id="vertex-shader" type="x-shader/x-vertex">
-    attribute vec4 test;
-    void main(void) {
-        gl_Position = test;
-    }
-</script>
-<script id="fragment-shader" type="x-shader/x-fragment">
-    precision mediump float;
-
-    void main(void) {
-        gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
-    }
-</script>
-<script>
 if (window.internals) {
     window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     window.internals.settings.setWebGL2Enabled(true);
@@ -507,50 +487,3 @@ function performConsoleActions() {
 
     context.createBuffer();
 }
-
-function test() {
-    let suite = InspectorTest.createAsyncSuite("Canvas.recordingWebGL2");
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL2.singleFrame",
-        description: "Check that the recording is stopped after a single frame.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject, {frameCount: 1});
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL2.multipleFrames",
-        description: "Check that recording data is serialized correctly for multiple frames.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject);
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL2.memoryLimit",
-        description: "Check that the recording is stopped when it reaches the memory limit.",
-        test(resolve, reject) {
-            startRecording(WI.Canvas.ContextType.WebGL2, resolve, reject, {memoryLimit: 10});
-        },
-        timeout: -1,
-    });
-
-    suite.addTestCase({
-        name: "Canvas.recordingWebGL2.Console",
-        description: "Check that a recording can be triggered by console.record().",
-        test(resolve, reject) {
-            consoleRecord(WI.Canvas.ContextType.WebGL2, resolve, reject);
-        },
-    });
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body onload="load()">
-    <p>Test that CanvasManager is able to record actions made to WebGL2 canvas contexts.</p>
-</body>
-</html>
index 562b6db..abb0469 100644 (file)
@@ -543,7 +543,10 @@ webkit.org/b/166536 fast/canvas/webgl/webgl2-runtime-flag.html [ Skip ]
 webkit.org/b/166536 fast/canvas/webgl/webgl2-texStorage.html [ Skip ]
 webkit.org/b/166536 fast/canvas/webgl/webgl2-texture-upload-enums.html [ Skip ]
 webkit.org/b/166536 inspector/canvas/create-context-webgl2.html [ Skip ]
-webkit.org/b/166536 inspector/canvas/recording-webgl2.html [ Skip ]
+webkit.org/b/166536 inspector/canvas/console-record-webgl2.html [ Skip ]
+webkit.org/b/166536 inspector/canvas/recording-webgl2-frameCount.html [ Skip ]
+webkit.org/b/166536 inspector/canvas/recording-webgl2-full.html [ Skip ]
+webkit.org/b/166536 inspector/canvas/recording-webgl2-memoryLimit.html [ Skip ]
 webkit.org/b/166536 inspector/canvas/recording-webgl2-snapshots.html [ Skip ]
 webkit.org/b/166536 inspector/canvas/requestContent-webgl2.html [ Skip ]
 webkit.org/b/166536 inspector/canvas/resolveCanvasContext-webgl2.html [ Skip ]
@@ -2192,7 +2195,11 @@ webkit.org/b/197507 legacy-animation-engine/animations/animation-multiple-callba
 webkit.org/b/197507 legacy-animation-engine/imported/blink/css3/calc/transition-asan-crash.html [ Timeout Pass ]
 webkit.org/b/197507 media/destructor-logging-crash.html [ Timeout Pass ]
 
-webkit.org/b/175662 inspector/canvas/recording-2d.html [ Failure Timeout ]
+webkit.org/b/175662 inspector/canvas/console-record-2d.html [ Failure Timeout ]
+webkit.org/b/175662 inspector/canvas/recording-2d-frameCount.html [ Failure Timeout ]
+webkit.org/b/175662 inspector/canvas/recording-2d-full.html [ Failure Timeout ]
+webkit.org/b/175662 inspector/canvas/recording-2d-memoryLimit.html [ Failure Timeout ]
+webkit.org/b/175662 inspector/canvas/recording-2d-saves.html [ Failure Timeout ]
 
 webkit.org/b/197711 imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html [ Pass Failure ]
 
@@ -3765,7 +3772,10 @@ webkit.org/b/193632 fast/text/narrow-non-breaking-space.html [ ImageOnlyFailure
 
 webkit.org/b/193323 http/wpt/cache-storage/cache-quota.any.html [ Failure ]
 
-webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer.html [ Failure ]
+webkit.org/b/193637 inspector/canvas/console-record-bitmaprenderer.html [ Failure ]
+webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer-frameCount.html [ Failure ]
+webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer-full.html [ Failure ]
+webkit.org/b/193637 inspector/canvas/recording-bitmaprenderer-memoryLimit.html [ Failure ]
 
 webkit.org/b/193638 media/video-webkit-playsinline.html [ Failure ]
 
index 4171f10..06b7fd3 100644 (file)
@@ -1027,11 +1027,14 @@ http/tests/security/contentSecurityPolicy/media-src-allowed.html [ Skip ]
 
 webkit.org/b/150978 fast/canvas/webgl/oes-texture-half-float-linear.html [ Pass Failure ]
 
+webkit.org/b/174066 inspector/canvas/console-record-webgl2.html [ Pass Timeout ]
 webkit.org/b/173931 inspector/canvas/context-attributes.html [ Pass Timeout ]
 webkit.org/b/178028 inspector/canvas/create-context-2d.html [ Pass Timeout ]
 webkit.org/b/174066 inspector/canvas/create-context-webgl2.html [ Pass Timeout ]
 webkit.org/b/174272 inspector/canvas/css-canvas-clients.html [ Pass Failure ]
-webkit.org/b/174066 inspector/canvas/recording-webgl2.html [ Pass Failure Timeout ]
+webkit.org/b/174066 inspector/canvas/recording-webgl2-frameCount.html [ Pass Failure Timeout ]
+webkit.org/b/174066 inspector/canvas/recording-webgl2-full.html [ Pass Failure Timeout ]
+webkit.org/b/174066 inspector/canvas/recording-webgl2-memoryLimit.html [ Pass Failure Timeout ]
 webkit.org/b/174066 inspector/canvas/recording-webgl2-snapshots.html [ Pass Failure Timeout ]
 webkit.org/b/174066 inspector/canvas/shaderProgram-add-remove-webgl2.html [ Pass Failure Timeout ]
 webkit.org/b/160048 [ Debug ] inspector/codemirror/prettyprinting-javascript.html [ Pass Timeout ]
index 81da55a..c2e781a 100644 (file)
@@ -1979,11 +1979,17 @@ fast/images/webgl-teximage2d.html [ Skip ]
 http/tests/security/webgl-remote-read-remote-image-allowed.html [ Skip ]
 http/tests/security/webgl-remote-read-remote-image-allowed-with-credentials.html [ Skip ]
 http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html [ Skip ]
+inspector/canvas/console-record-webgl.html [ Skip ]
 inspector/canvas/create-context-webgl.html [ Skip ]
+inspector/canvas/console-record-webgl2.html [ Skip ]
 inspector/canvas/create-context-webgl2.html [ Skip ]
-inspector/canvas/recording-webgl.html [ Skip ]
+inspector/canvas/recording-webgl-frameCount.html [ Skip ]
+inspector/canvas/recording-webgl-full.html [ Skip ]
+inspector/canvas/recording-webgl-memoryLimit.html [ Skip ]
 inspector/canvas/recording-webgl-snapshots.html [ Skip ]
-inspector/canvas/recording-webgl2.html [ Skip ]
+inspector/canvas/recording-webgl2-frameCount.html [ Skip ]
+inspector/canvas/recording-webgl2-full.html [ Skip ]
+inspector/canvas/recording-webgl2-memoryLimit.html [ Skip ]
 inspector/canvas/recording-webgl2-snapshots.html [ Skip ]
 inspector/canvas/requestContent-webgl.html [ Skip ]
 inspector/canvas/requestContent-webgl2.html [ Skip ]