| Index: Tools/GardeningServer/ui/ct-results-comparison-tests.html
|
| diff --git a/Tools/GardeningServer/ui/ct-results-comparison-tests.html b/Tools/GardeningServer/ui/ct-results-comparison-tests.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f61af401255cfb8cd98b4037d1392878e7f5dc3e
|
| --- /dev/null
|
| +++ b/Tools/GardeningServer/ui/ct-results-comparison-tests.html
|
| @@ -0,0 +1,93 @@
|
| +<!--
|
| +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.html">
|
| +
|
| +<script>
|
| +(function () {
|
| +
|
| +module("ct-results-comparison");
|
| +
|
| +asyncTest("text", 4, function() {
|
| + var comparison = document.createElement('ct-results-comparison');
|
| + comparison.type = results.kTextType;
|
| + comparison.diffUrl = "http://domain.com/dummy-diff";
|
| +
|
| + Platform.endOfMicrotask(function() {
|
| + equal(comparison.shadowRoot.querySelectorAll('img').length, 0);
|
| + equal(comparison.shadowRoot.querySelectorAll('audio').length, 0);
|
| +
|
| + var iframes = comparison.shadowRoot.querySelectorAll('iframe');
|
| + equal(iframes.length, 1);
|
| + equal(iframes[0].src, 'http://domain.com/dummy-diff');
|
| + start();
|
| + });
|
| +});
|
| +
|
| +asyncTest("audio", 4, function() {
|
| + var comparison = document.createElement('ct-results-comparison');
|
| + comparison.type = results.kAudioType;
|
| + comparison.expectedUrl = "http://domain.com/dummy-expected";
|
| +
|
| + Platform.endOfMicrotask(function() {
|
| + equal(comparison.shadowRoot.querySelectorAll('img').length, 0);
|
| + equal(comparison.shadowRoot.querySelectorAll('iframe').length, 0);
|
| +
|
| + var audios = comparison.shadowRoot.querySelectorAll('audio');
|
| + equal(audios.length, 1);
|
| + equal(audios[0].src, 'http://domain.com/dummy-expected');
|
| + start();
|
| + });
|
| +});
|
| +
|
| +asyncTest("image", 6, function() {
|
| + var comparison = document.createElement('ct-results-comparison');
|
| + comparison.type = results.kImageType;
|
| + comparison.actualUrl = "http://domain.com/dummy-actual";
|
| + comparison.diffUrl = "http://domain.com/dummy-diff";
|
| + comparison.expectedUrl = "http://domain.com/dummy-expected";
|
| +
|
| + Platform.endOfMicrotask(function() {
|
| + equal(comparison.shadowRoot.querySelectorAll('iframe').length, 0);
|
| + equal(comparison.shadowRoot.querySelectorAll('audio').length, 0);
|
| +
|
| + var images = comparison.shadowRoot.querySelectorAll('img');
|
| + equal(images.length, 3);
|
| + equal(images[0].src, 'http://domain.com/dummy-expected');
|
| + equal(images[1].src, 'http://domain.com/dummy-actual');
|
| + equal(images[2].src, 'http://domain.com/dummy-diff');
|
| + start();
|
| + });
|
| +});
|
| +
|
| +asyncTest("no-urls", 3, function() {
|
| + var comparison = document.createElement('ct-results-comparison');
|
| + comparison.type = results.kImageType;
|
| +
|
| + Platform.endOfMicrotask(function() {
|
| + equal(comparison.shadowRoot.querySelectorAll('iframe').length, 0);
|
| + equal(comparison.shadowRoot.querySelectorAll('audio').length, 0);
|
| + equal(comparison.shadowRoot.querySelectorAll('img').length, 0);
|
| + start();
|
| + });
|
| +});
|
| +
|
| +asyncTest("no-type", 3, function() {
|
| + var comparison = document.createElement('ct-results-comparison');
|
| + comparison.actualUrl = "http://domain.com/dummy-actual";
|
| + comparison.diffUrl = "http://domain.com/dummy-diff";
|
| + comparison.expectedUrl = "http://domain.com/dummy-expected";
|
| +
|
| + Platform.endOfMicrotask(function() {
|
| + equal(comparison.shadowRoot.querySelectorAll('iframe').length, 0);
|
| + equal(comparison.shadowRoot.querySelectorAll('audio').length, 0);
|
| + equal(comparison.shadowRoot.querySelectorAll('img').length, 0);
|
| + start();
|
| + });
|
| +});
|
| +
|
| +})()
|
| +</script>
|
|
|