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

Unified Diff: test/iron_list_test_helpers.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 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 | « test/iron_list_physical_count_test.html ('k') | test/iron_localstorage_basic_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/iron_list_test_helpers.dart
diff --git a/test/iron_list_test_helpers.dart b/test/iron_list_test_helpers.dart
index 740a374366a7a88817f59c6c0fc2a05cb3f010ed..66b079a6e4147558c607c90d1a18543557c73a63 100644
--- a/test/iron_list_test_helpers.dart
+++ b/test/iron_list_test_helpers.dart
@@ -5,6 +5,7 @@ library polymer_elements.test.iron_list_test_helpers;
import 'dart:html';
import 'dart:js';
+import 'package:polymer_elements/iron_list.dart';
import 'common.dart';
JsFunction _matchesSelector = context['Polymer']['DomApi']['matchesSelector'];
@@ -73,3 +74,25 @@ Element getLastItemFromList(list) {
return document.elementFromPoint((listRect.left + 1).floor(),
(listRect.top + listRect.height - 1).floor());
}
+
+isFullOfItems(IronList list) {
+ var listRect = list.getBoundingClientRect();
+ var listHeight = listRect.height - 1;
+ var item, y = listRect.top + 1;
+ // IE 10 & 11 doesn't render propertly :(
+ var badPixels = 0;
+ while (y < listHeight) {
+ item = document.elementFromPoint((listRect.left + 1).floor(), y.floor())
+ as HtmlElement;
+ if (item.parentNode != null &&
+ new JsObject.fromBrowserObject(item.parentNode)['_templateInstance'] ==
+ null) {
+ badPixels++;
+ }
+ if (badPixels > 3) {
+ return false;
+ }
+ y += 2;
+ }
+ return true;
+}
« no previous file with comments | « test/iron_list_physical_count_test.html ('k') | test/iron_localstorage_basic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698