Index: Tools/GardeningServer/ui/test/ct-popout-iframe.html |
diff --git a/Tools/GardeningServer/ui/test/ct-popout-iframe.html b/Tools/GardeningServer/ui/test/ct-popout-iframe.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9415e82e96ae62752da8eace9e90f6f7d11e62d0 |
--- /dev/null |
+++ b/Tools/GardeningServer/ui/test/ct-popout-iframe.html |
@@ -0,0 +1,41 @@ |
+<!-- |
+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-popout-iframe.html"> |
+ |
+<script> |
+(function() { |
+ |
+var assert = chai.assert; |
+ |
+describe('ct-popout-iframe', function() { |
+ it('has iframe and link', function() { |
+ var elem = document.createElement('ct-popout-iframe'); |
+ |
+ var iframes = elem.shadowRoot.getElementsByTagName('iframe'); |
ojan
2014/09/12 00:22:17
Use querySelectorAll. It's more modern and less cr
Robert Sesek
2014/09/12 13:58:59
Done.
|
+ assert.lengthOf(iframes, 1); |
+ |
+ var links = elem.shadowRoot.getElementsByTagName('a'); |
+ assert.lengthOf(links, 1); |
+ |
+ var thisHref = location.href; |
+ assert.lengthOf(iframes[0].src, thisHref.length); |
+ assert.lengthOf(links[0].href, thisHref.length); |
ojan
2014/09/12 00:22:16
Why check lengthOf instead of equal? Probably dese
Robert Sesek
2014/09/12 13:58:59
Switched to just .equal().
|
+ |
+ var url = 'http://example.com/results.txt'; |
+ elem.src = url; |
+ |
+ describe('src', function() { |
+ it('set to a URL', function() { |
+ assert.equal(iframes[0].src, url); |
+ assert.equal(links[0].href, url); |
+ }); |
+ }); |
+ }); |
+}); |
+ |
+})(); |
+</script> |