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

Side by Side Diff: Tools/GardeningServer/ui/ct-results-comparison-zoomer-tests.html

Issue 403983002: Port pixelzoomer.js/css to ct-results-comparison. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make component. add tests. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/ui/ct-results-comparison-zoomer.html ('k') | Tools/GardeningServer/ui/ct-test-output.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698