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

Unified Diff: content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html

Issue 2358833002: Update pixel test expectation and add new worker tests (Closed)
Patch Set: back to PS4 Created 4 years, 3 months 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 | content/test/gpu/gpu_tests/pixel_expectations.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
diff --git a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html b/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
similarity index 69%
copy from content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html
copy to content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
index 3ae0e56c24d2c1864f35277dbaa6b75ff33191d1..d4a9ea713d881c86af13fffbb099c1210e6874b8 100644
--- a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html
+++ b/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
@@ -8,15 +8,29 @@ that the baseline images are regenerated on the next run.
<html>
<head>
-<title>OffscreenCanvas commit flow on main thread: green square on white background.</title>
+<title>OffscreenCanvas commit flow on worker thread: red square on white background.</title>
<style type="text/css">
.nomargin {
margin: 0px auto;
}
</style>
+<script id="myWorker" type="text/worker">
+self.onmessage = function(e) {
+ var transferredOffscreenCanvas = e.data;
+ var gl = transferredOffscreenCanvas.getContext("webgl");
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.commit();
+};
+</script>
<script>
var g_swapsBeforeAck = 15;
+function makeWorker(script) {
+ var blob = new Blob([script]);
+ return new Worker(URL.createObjectURL(blob));
+}
+
function main()
{
draw();
@@ -27,10 +41,8 @@ function draw()
{
var canvas = document.getElementById("c");
var offscreenCanvas = canvas.transferControlToOffscreen();
- var gl = offscreenCanvas.getContext("webgl");
- gl.clearColor(0.0, 1.0, 0.0, 1.0);
- gl.clear(gl.COLOR_BUFFER_BIT);
- gl.commit();
+ var worker = makeWorker(document.getElementById("myWorker").textContent);
+ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
}
function waitForFinish()
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/pixel_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698