OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. |
| 5 --> |
| 6 |
| 7 <link rel="import" href="ct-results-comparison-zoomer.html"> |
| 8 |
| 9 <script> |
| 10 (function () { |
| 11 |
| 12 module("ct-results-comparison-zoomer"); |
| 13 |
| 14 asyncTest("no-position", 2, function() { |
| 15 var zoomer = document.createElement('ct-results-comparison-zoomer'); |
| 16 // FIXME: This should set zoomer.position instead, but there's no way |
| 17 // to get between the microtask and requestAnimationFrame to verify the |
| 18 // behavior. |
| 19 zoomer.positionChanged(); |
| 20 ok(zoomer._drawScheduled); |
| 21 |
| 22 requestAnimationFrame(function() { |
| 23 ok(!zoomer._drawScheduled); |
| 24 start(); |
| 25 }); |
| 26 }); |
| 27 |
| 28 test("draw", 3, function() { |
| 29 // Hard to verify correct behavior here, but at least make sure the |
| 30 // code executes without throwing errors. |
| 31 |
| 32 var zoomer = document.createElement('ct-results-comparison-zoomer'); |
| 33 |
| 34 try { |
| 35 zoomer._drawAll(); |
| 36 ok(true); |
| 37 } catch(e) { |
| 38 ok(false); |
| 39 } |
| 40 |
| 41 // FIXME: Use a proper model class instead of a dumb object. |
| 42 zoomer.position = {x: 0, y: 0}; |
| 43 try { |
| 44 zoomer._drawAll(); |
| 45 ok(true); |
| 46 } catch(e) { |
| 47 ok(false); |
| 48 } |
| 49 |
| 50 try { |
| 51 zoomer._draw(zoomer.$.diffZoomer); |
| 52 ok(true); |
| 53 } catch(e) { |
| 54 ok(false); |
| 55 } |
| 56 }); |
| 57 |
| 58 })() |
| 59 </script> |
OLD | NEW |