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

Unified Diff: test/iron_a11y_keys_behavior_test.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_a11y_announcer_test.dart ('k') | test/iron_a11y_keys_behavior_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/iron_a11y_keys_behavior_test.dart
diff --git a/test/iron_a11y_keys_behavior_test.dart b/test/iron_a11y_keys_behavior_test.dart
index 23d65051108cb1e768180c738c47a723d824a9ca..ba9e6ad0a4bf8982b05ab578c244354aa738363a 100644
--- a/test/iron_a11y_keys_behavior_test.dart
+++ b/test/iron_a11y_keys_behavior_test.dart
@@ -57,6 +57,19 @@ main() async {
// pressSpace(keys);
// expect(keys.keyCount, 1);
});
+
+ test('allows propagation beyond the key combo handler', () {
+ var called = false;
+ var done = document.on['keydown'].first.then((_) {
+ called = true;
+ });
+
+ pressEnter(keys);
+
+ expect(called, true);
+
+ return done;
+ });
group('edge cases', () {
test('knows that `spacebar` is the same as `space`', () {
@@ -141,6 +154,25 @@ main() async {
expect(keys.keyCount, 2);
});
});
+
+ group('stopping propagation automatically', () {
+ setUp(() {
+ keys = fixture('NonPropagatingKeys');
+ });
+
+ test('does not propagate key events beyond the combo handler', () async {
+ var called = false;
+
+ document.on['keydown'].first.then((_) {
+ called = true;
+ });
+
+ pressEnter(keys);
+ await wait(1);
+
+ expect(called, isFalse);
+ });
+ });
});
}
« no previous file with comments | « test/iron_a11y_announcer_test.dart ('k') | test/iron_a11y_keys_behavior_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698