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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-after-destroy-iframe.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-destroy-iframe.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-destroy-iframe.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-destroy-iframe.html
index 1928f4b20f30651ddfabde9aac5dabaa7603905b..36553bb780d4bb82450d348bf8073eca99b0c7da 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-destroy-iframe.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-after-destroy-iframe.html
@@ -1,15 +1,11 @@
<!DOCTYPE html>
<html>
<head>
- <script src="../../resources/js-test.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
-}
-
var barrier = 2;
function frameLoaded()
{
@@ -20,13 +16,13 @@ function frameLoaded()
function runTest()
{
- debug("check if re-parenting canvas keeps its context.")
- canvasTest(document.getElementById("frame1"), true);
- debug("check if detaching canvas loses its context.")
- canvasTest(document.getElementById("frame2"), false);
+ test(function(t) {
+ canvasTest(document.getElementById("frame1"), true);
+ }, 'check if re-parenting canvas keeps its context.');
- if (window.testRunner)
- testRunner.notifyDone();
+ test(function(t) {
+ canvasTest(document.getElementById("frame2"), false);
+ }, 'check if detaching canvas loses its context.');
}
var data;
@@ -39,9 +35,9 @@ function canvasTest(frame, adoptCanvas)
var imageData;
imageData = ctx.getImageData(100, 100, 1, 1);
data = imageData.data;
- shouldBe('data[0]', '255');
- shouldBe('data[1]', '0');
- shouldBe('data[2]', '0');
+ assert_equals(data[0], 255);
+ assert_equals(data[1], 0);
+ assert_equals(data[2], 0);
if (adoptCanvas)
parent.appendChild(canvas);
@@ -50,13 +46,13 @@ function canvasTest(frame, adoptCanvas)
imageData = ctx.getImageData(100, 100, 1, 1);
data = imageData.data;
if (adoptCanvas) {
- shouldBe('data[0]', '255');
+ assert_equals(data[0], 255);
} else {
// GC causes active DOM stop and canvas loses its context.
- shouldBe('data[0]', '0');
+ assert_equals(data[0], 0);
}
- shouldBe('data[1]', '0');
- shouldBe('data[2]', '0');
+ assert_equals(data[1], 0);
+ assert_equals(data[2], 0);
}
</script>
<div id="parent">

Powered by Google App Engine
This is Rietveld 408576698