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

Unified Diff: third_party/WebKit/LayoutTests/fast/images/webgl-teximage2d.html

Issue 2253513005: Use testharness.js instead of js-test.js in fast/images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change test as per the comments. 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/images/webgl-teximage2d.html
diff --git a/third_party/WebKit/LayoutTests/fast/images/webgl-teximage2d.html b/third_party/WebKit/LayoutTests/fast/images/webgl-teximage2d.html
index ed96a5d72095a27a2f606a634be6d69fcceb5c29..00276201492c92f4224ad7a4c250b222ce0df1e9 100644
--- a/third_party/WebKit/LayoutTests/fast/images/webgl-teximage2d.html
+++ b/third_party/WebKit/LayoutTests/fast/images/webgl-teximage2d.html
@@ -1,36 +1,18 @@
-<script src="../../resources/js-test.js"></script>
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script src="../canvas/webgl/resources/webgl-test.js"></script>
-<canvas id="canvas" width="0" height="0"> </canvas>
-<img src="resources/green.jpg" width="0" height="0" id="image"></img>
+<canvas width="0" height="0"> </canvas>
+<img src="resources/green.jpg" width="0" height="0"></img>
<script>
-jsTestIsAsync = true;
-
-var gl = create3DContext(document.getElementById("canvas"));
-if (!gl) {
- testFailed("context does not exist");
-} else {
- testPassed("context exists");
-}
-
-var enums = new Array();
-for (var name in gl) {
- if (typeof gl[name] == 'number')
- enums[gl[name]] = name;
-}
-
-var img = document.getElementById("image");
-img.onload = function() {
- var texture = gl.createTexture();
- gl.bindTexture(gl.TEXTURE_2D, texture);
- try {
+async_test(function(t) {
+ var gl = create3DContext(document.querySelector("canvas"));
+ var img = document.querySelector("img");
+ img.onload = t.step_func_done(function() {
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
- var err = gl.getError();
- if (err != gl.NO_ERROR)
- throw "WebGL error: " + enums[err];
- testPassed("OK");
- } catch (e) {
- testFailed(e.toString());
- }
- finishJSTest();
-}
+ assert_equals(gl.getError(), gl.NO_ERROR);
+ });
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698