Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-multiple-worker-commit.html

Issue 2502853003: Make OffscreenCanvas histogram thread safe (Closed)
Patch Set: nits Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-multiple-worker-commit.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-multiple-worker-commit.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-multiple-worker-commit.html
new file mode 100644
index 0000000000000000000000000000000000000000..fe8d0e6030d539d8978c4021de221fcfb6740816
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-multiple-worker-commit.html
@@ -0,0 +1,40 @@
+<!DOCTYPE>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script id="myWorker" type="text/worker">
+self.onmessage = function(e) {
+ var offscreenCanvas = e.data;
+ var offscreen2d = offscreenCanvas.getContext("2d");
+ offscreen2d.commit();
+ self.postMessage("worker done");
+};
+</script>
+<script>
+function makeWorker() {
+ var blob = new Blob([document.getElementById("myWorker").textContent]);
+ return new Worker(URL.createObjectURL(blob));
+}
+
+// Regression test for crbug.com/663916
+async_test(function(t) {
+ var canvas1 = document.createElement('canvas');
+ canvas1.width = canvas1.height = 10;
+ var offscreenCanvas1 = canvas1.transferControlToOffscreen();
+
+ var canvas2 = document.createElement('canvas');
+ canvas2.width = canvas2.height = 10;
+ var offscreenCanvas2 = canvas2.transferControlToOffscreen();
+
+ var worker1 = makeWorker();
+ var worker2 = makeWorker();
+ var returnedWorkerCounter = 0;
+ worker1.onmessage = worker2.onmessage = function (e) {
+ returnedWorkerCounter++;
+ if (returnedWorkerCounter == 2)
+ t.done();
+ };
+ worker1.postMessage(offscreenCanvas1, [offscreenCanvas1]);
+ worker2.postMessage(offscreenCanvas2, [offscreenCanvas2]);
+}, "Calling OffscreenCanvas.commit() from two workers should not crash.");
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698