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> |