Index: third_party/polymer/components-chromium/paper-dropdown-menu/test/basic.html |
diff --git a/third_party/polymer/components-chromium/core-dropdown/test/basic.html b/third_party/polymer/components-chromium/paper-dropdown-menu/test/basic.html |
similarity index 59% |
copy from third_party/polymer/components-chromium/core-dropdown/test/basic.html |
copy to third_party/polymer/components-chromium/paper-dropdown-menu/test/basic.html |
index 1f9a114042a1b3ed48fdde5556df042b7df2076e..313dd49a67ec267541d977a0980d8e9e248d2073 100644 |
--- a/third_party/polymer/components-chromium/core-dropdown/test/basic.html |
+++ b/third_party/polymer/components-chromium/paper-dropdown-menu/test/basic.html |
@@ -10,7 +10,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
<html> |
<head> |
<meta charset="UTF-8"> |
- <title>core-dropdown basic tests</title> |
+ <title>paper-dropdown-menu basic tests</title> |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> |
<script src="../../webcomponentsjs/webcomponents.js"></script> |
@@ -35,49 +35,30 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
<div relative id="trigger2"> |
tap |
- <core-dropdown id="dropdown2" valign="bottom">Hello World!</core-dropdown> |
+ <core-dropdown id="dropdown2">Hello World!</core-dropdown> |
</div> |
<div relative id="trigger3"> |
tap |
- <core-dropdown id="dropdown3" halign="right">Hello World!</core-dropdown> |
- </div> |
- |
- <div relative id="trigger4"> |
- tap |
- <core-dropdown id="dropdown4" layered>Hello World!</core-dropdown> |
- </div> |
- |
- <div relative id="trigger5"> |
- tap |
- <core-dropdown id="dropdown5" layered valign="bottom">Hello World!</core-dropdown> |
- </div> |
- |
- <div relative id="trigger6"> |
- tap |
- <core-dropdown id="dropdown6" layered halign="right">Hello World!</core-dropdown> |
+ <core-dropdown id="dropdown3">Hello World!</core-dropdown> |
</div> |
<script> |
- function approxEqual(a, b) { |
- return assert.equal(Math.round(a), Math.round(b)); |
- } |
- |
function assertPosition(dropdown, trigger) { |
var dr = dropdown.getBoundingClientRect(); |
var tr = trigger.getBoundingClientRect(); |
if (dropdown.halign === 'left') { |
- approxEqual(dr.left, tr.left); |
+ assert.equal(dr.left, tr.left); |
} else { |
- approxEqual(dr.right, tr.right); |
+ assert.equal(dr.right, tr.right); |
} |
if (dropdown.valign === 'top') { |
- approxEqual(dr.top, tr.top); |
+ assert.equal(dr.top, tr.top); |
} else { |
- approxEqual(dr.bottom, tr.bottom); |
+ assert.equal(dr.bottom, tr.bottom); |
} |
}; |
@@ -92,21 +73,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
var d1 = document.getElementById('dropdown1'); |
var t1 = document.getElementById('trigger1'); |
+ d1.relatedTarget = t1; |
var d2 = document.getElementById('dropdown2'); |
var t2 = document.getElementById('trigger2'); |
+ d2.relatedTarget = t2; |
var d3 = document.getElementById('dropdown3'); |
var t3 = document.getElementById('trigger3'); |
- |
- var d4 = document.getElementById('dropdown4'); |
- var t4 = document.getElementById('trigger4'); |
- |
- var d5 = document.getElementById('dropdown5'); |
- var t5 = document.getElementById('trigger5'); |
- |
- var d6 = document.getElementById('dropdown6'); |
- var t6 = document.getElementById('trigger6'); |
+ d3.relatedTarget = t3; |
test('default', function(done) { |
d1.opened = true; |
@@ -117,6 +92,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
}); |
test('bottom alignment', function(done) { |
+ d2.valign = 'bottom'; |
d2.opened = true; |
flushLayoutAndRender(function() { |
assertPosition(d2, t2); |
@@ -125,6 +101,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
}); |
test('right alignment', function(done) { |
+ d3.halign = 'right'; |
d3.opened = true; |
flushLayoutAndRender(function() { |
assertPosition(d3, t3); |
@@ -132,30 +109,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
}); |
}); |
- test('layered', function(done) { |
- d4.opened = true; |
- flushLayoutAndRender(function() { |
- assertPosition(d4, t4); |
- done(); |
- }); |
- }); |
- |
- test('layered, bottom alignment', function(done) { |
- d5.opened = true; |
- flushLayoutAndRender(function() { |
- assertPosition(d5, t5); |
- done(); |
- }); |
- }); |
- |
- test('layered, right alignment', function(done) { |
- d6.opened = true; |
- flushLayoutAndRender(function() { |
- assertPosition(d6, t6); |
- done(); |
- }); |
- }); |
- |
</script> |
</body> |