Index: Tools/GardeningServer/ui/ct-results-comparison-zoomer-tests.html |
diff --git a/Tools/GardeningServer/ui/ct-results-comparison-zoomer-tests.html b/Tools/GardeningServer/ui/ct-results-comparison-zoomer-tests.html |
deleted file mode 100644 |
index 9cd0404d04ce0b51fa750b097d7bcb74aba51d84..0000000000000000000000000000000000000000 |
--- a/Tools/GardeningServer/ui/ct-results-comparison-zoomer-tests.html |
+++ /dev/null |
@@ -1,80 +0,0 @@ |
-<!-- |
-Copyright 2014 The Chromium Authors. All rights reserved. |
-Use of this source code is governed by a BSD-style license that can be |
-found in the LICENSE file. |
---> |
- |
-<link rel="import" href="ct-results-comparison-zoomer.html"> |
- |
-<link rel="import" href="../base/ct-canvas-2d-context-mock.html"> |
- |
-<script> |
-(function () { |
- |
-module("ct-results-comparison-zoomer"); |
- |
-asyncTest("no-position", 2, function() { |
- var zoomer = document.createElement('ct-results-comparison-zoomer'); |
- // FIXME: This should set zoomer.position instead, but there's no way |
- // to get between the microtask and requestAnimationFrame to verify the |
- // behavior. |
- zoomer.positionChanged(); |
- ok(zoomer._drawScheduled); |
- |
- requestAnimationFrame(function() { |
- ok(!zoomer._drawScheduled); |
- start(); |
- }); |
-}); |
- |
-test("draw", 3, function() { |
- // Hard to verify correct behavior here, but at least make sure the |
- // code executes without throwing errors. |
- |
- var zoomer = document.createElement('ct-results-comparison-zoomer'); |
- |
- try { |
- zoomer._drawAll(); |
- ok(true); |
- } catch(e) { |
- ok(false); |
- } |
- |
- // FIXME: Use a proper model class instead of a dumb object. |
- zoomer.position = {x: 0, y: 0}; |
- try { |
- zoomer._drawAll(); |
- ok(true); |
- } catch(e) { |
- ok(false); |
- } |
- |
- try { |
- zoomer._draw(zoomer.$.diffZoomer); |
- ok(true); |
- } catch(e) { |
- ok(false); |
- } |
-}); |
- |
-asyncTest("drawCanvas", 1, function() { |
- var zoomer = document.createElement('ct-results-comparison-zoomer'); |
- zoomer.position = {x: 0.2, y: 0.5}; |
- |
- requestAnimationFrame(function() { |
- var canvasContext = new CTCanvas2dContextMock(); |
- zoomer._drawCanvas(canvasContext, zoomer.$.diffZoomer); |
- |
- var expectedContext = new CTCanvas2dContextMock(); |
- expectedContext.imageSmoothingEnabled = false; |
- expectedContext.translate(-960, -1800); |
- expectedContext.strokeRect(-1.5, -1.5, 4802, 3602); |
- expectedContext.scale(6, 6); |
- expectedContext.drawImage(zoomer.shadowRoot.querySelector('img'), 0, 0); |
- deepEqual(canvasContext, expectedContext); |
- start(); |
- }); |
-}); |
- |
-})() |
-</script> |