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

Unified 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 side-by-side diff with in-line comments
Download patch
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
new file mode 100644
index 0000000000000000000000000000000000000000..e678b2087cb5c9ad78f579faa2bdad2240cb9cd9
--- /dev/null
+++ b/Tools/GardeningServer/ui/ct-results-comparison-zoomer-tests.html
@@ -0,0 +1,59 @@
+<!--
+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">
+
+<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);
+ }
+});
+
+})()
+</script>
« 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