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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-after-detachment.html

Issue 2671853004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Corrections Created 3 years, 10 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/canvas-after-detachment.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-detachment.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-detachment.html
index e304ca25fe5be347d0b40e432c7c0fb8318e0dd2..d428f4a12a676a23b5a072809c465a3244c3e445 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-detachment.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-detachment.html
@@ -1,20 +1,9 @@
-<!DOCTYPE html>
-<html>
-<head>
- <script src="../../resources/js-test.js"></script>
-</head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<div id="parent">
<canvas id="mycanvas" width="200" height="200"></canvas>
-</div>
<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
-var data;
-function runTest()
-{
+test(function(t) {
var parent = document.getElementById("parent");
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
@@ -23,10 +12,10 @@ function runTest()
var imageData;
imageData = ctx.getImageData(100, 100, 1, 1);
- data = imageData.data;
- shouldBe('data[0]', '255');
- shouldBe('data[1]', '0');
- shouldBe('data[2]', '0');
+ var data = imageData.data;
+ assert_equals(data[0], 255);
+ assert_equals(data[1], 0);
+ assert_equals(data[2], 0);
parent.removeChild(canvas);
// GC makes sure canvas element is removed.
@@ -35,16 +24,8 @@ function runTest()
imageData = ctx.getImageData(100, 100, 1, 1);
data = imageData.data;
- // The context is valid although the canvas is detached from document.
- shouldBe('data[0]', '255');
- shouldBe('data[1]', '0');
- shouldBe('data[2]', '0');
-
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-runTest();
+ assert_equals(data[0], 255);
+ assert_equals(data[1], 0);
+ assert_equals(data[2], 0);
+}, 'Test that the context is valid although the canvas is detached from document.');
</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698