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

Unified Diff: Tools/GardeningServer/ui/ct-test-output-tests.html

Issue 350563002: Port first garden-o-matic component over to polymer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add files Created 6 years, 6 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
« no previous file with comments | « Tools/GardeningServer/ui/ct-test-output.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/ui/ct-test-output-tests.html
diff --git a/Tools/GardeningServer/ui/ct-test-output-tests.html b/Tools/GardeningServer/ui/ct-test-output-tests.html
new file mode 100644
index 0000000000000000000000000000000000000000..5f4e1a3ccec24b68c6feaf94d684786d72ca60b5
--- /dev/null
+++ b/Tools/GardeningServer/ui/ct-test-output-tests.html
@@ -0,0 +1,101 @@
+<!--
+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-test-output.html">
+
+<script>
+(function () {
+
+module("ct-test-output");
+
+asyncTest("image", 4, function() {
+ var output = document.createElement('ct-test-output');
+ output.type = results.kImageType;
+
+ var url = "http://domain.com/dummy-expected";
+ output.url = url;
+
+ Platform.endOfMicrotask(function() {
+ equal(output.shadowRoot.querySelectorAll('iframe').length, 0);
+ equal(output.shadowRoot.querySelectorAll('audio').length, 0);
+
+ var images = output.shadowRoot.querySelectorAll('img');
+ equal(images.length, 1);
+ equal(images[0].src, url);
+
+ start();
+ });
+});
+
+asyncTest("text", 4, function() {
+ var output = document.createElement('ct-test-output');
+ output.type = results.kTextType;
+
+ var url = "http://domain.com/dummy-expected";
+ output.url = url;
+
+ Platform.endOfMicrotask(function() {
+ equal(output.shadowRoot.querySelectorAll('img').length, 0);
+ equal(output.shadowRoot.querySelectorAll('audio').length, 0);
+
+ var images = output.shadowRoot.querySelectorAll('iframe');
+ equal(images.length, 1);
+ equal(images[0].src, url);
+
+ start();
+ });
+});
+
+asyncTest("audio", 4, function() {
+ var output = document.createElement('ct-test-output');
+ output.type = results.kAudioType;
+
+ var url = "http://domain.com/dummy-expected";
+ output.url = url;
+
+ Platform.endOfMicrotask(function() {
+ equal(output.shadowRoot.querySelectorAll('iframe').length, 0);
+ equal(output.shadowRoot.querySelectorAll('img').length, 0);
+
+ var images = output.shadowRoot.querySelectorAll('audio');
+ equal(images.length, 1);
+ equal(images[0].src, url);
+
+ start();
+ });
+});
+
+asyncTest("unknown-type", 3, function() {
+ var output = document.createElement('ct-test-output');
+ output.type = 'garbage';
+
+ var url = "http://domain.com/dummy-expected";
+ output.url = url;
+
+ Platform.endOfMicrotask(function() {
+ equal(output.shadowRoot.querySelectorAll('iframe').length, 0);
+ equal(output.shadowRoot.querySelectorAll('audio').length, 0);
+ equal(output.shadowRoot.querySelectorAll('img').length, 0);
+
+ start();
+ });
+});
+
+asyncTest("no-url", 3, function() {
+ var output = document.createElement('ct-test-output');
+ output.type = results.kImageType;
+
+ Platform.endOfMicrotask(function() {
+ equal(output.shadowRoot.querySelectorAll('iframe').length, 0);
+ equal(output.shadowRoot.querySelectorAll('audio').length, 0);
+ equal(output.shadowRoot.querySelectorAll('img').length, 0);
+
+ start();
+ });
+});
+
+})()
+</script>
« no previous file with comments | « Tools/GardeningServer/ui/ct-test-output.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698