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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext-in-worker.html

Issue 2271593002: Convert OffscreenCanvas-getContext tests to testharness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext-in-worker.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext-in-worker.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext-in-worker.html
index 0838947b67235c2df4c071f2d09305950eaeac58..6f24643a4d561decb2a5d1dbe7c62a3b3cfeb61d 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext-in-worker.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-getContext-in-worker.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<html>
-<script src="../../resources/js-test.js"></script>
-<body>
+<title>Tests that the 2D and webgl context of OffscreenCanvas can be constructed on a worker thread.</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script id="myWorker" type="text/worker">
self.onmessage = function(e) {
Srirama 2016/08/23 06:34:24 you can remove 'e'.
sivag 2016/08/25 07:39:01 Done.
var aCanvas = new OffscreenCanvas(50, 50);
Srirama 2016/08/23 06:34:24 Use same indentation everywhere either 2 or 4.
sivag 2016/08/25 07:39:01 Done.
@@ -21,30 +21,20 @@ self.onmessage = function(e) {
}
};
</script>
-
<script>
-jsTestIsAsync = true;
-description("Tests that the 2D and webgl context of OffscreenCanvas can be constructed on a worker thread.");
-
-function makeWorker(script) {
- var blob = new Blob([script]);
- return new Worker(URL.createObjectURL(blob));
-}
+async_test(function(t) {
+ function makeWorker(script) {
+ var blob = new Blob([script]);
+ return new Worker(URL.createObjectURL(blob));
+ }
-function handleMessageFromWorker(msg)
-{
- if (msg.data == "success") {
- testPassed("getContext('2d') and getContext('webgl') works on a worker thread");
- } else {
- testFailed(msg.data);
+ function handleMessageFromWorker(msg) {
+ assert_equals(msg.data, "success");
+ t.done();
}
- finishJSTest();
-}
-var worker = makeWorker(document.getElementById('myWorker').textContent);
-worker.addEventListener('message', handleMessageFromWorker);
-worker.postMessage("");
+ var worker = makeWorker(document.getElementById('myWorker').textContent);
+ worker.addEventListener('message', handleMessageFromWorker);
Srirama 2016/08/23 06:34:24 may be inline hte function here. like worker.onme
sivag 2016/08/25 07:39:01 Done. Modified using fetch_tests_from_worker.
sivag 2016/08/25 07:39:01 Done.
+ worker.postMessage("");
+});
</script>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698