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

Unified Diff: polymer_1.2.3/bower_components/iron-menu-behavior/test/iron-menu-behavior.html

Issue 1581713003: [third_party] add polymer 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: 1.2.3 Created 4 years, 11 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
Index: polymer_1.2.3/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
diff --git a/polymer_1.0.4/bower_components/iron-menu-behavior/test/iron-menu-behavior.html b/polymer_1.2.3/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
similarity index 71%
copy from polymer_1.0.4/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
copy to polymer_1.2.3/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
index 309dbb163a28c9cc31368c3b2929477e0fcf483a..92ffc44fe709c074d7a0d952b51510d554c1f1ae 100644
--- a/polymer_1.0.4/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
+++ b/polymer_1.2.3/bower_components/iron-menu-behavior/test/iron-menu-behavior.html
@@ -17,12 +17,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
- <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
+ <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
- <script src="../../test-fixture/test-fixture-mocha.js"></script>
-
- <link rel="import" href="../../test-fixture/test-fixture.html">
+ <script src="../../iron-test-helpers/mock-interactions.js"></script>
<link rel="import" href="test-menu.html">
</head>
@@ -48,6 +46,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
+
+ <test-fixture id="nested">
+ <template>
+ <test-menu>
+ <test-menu>
+ <div>item 1</div>
+ <div>item 2</div>
+ <div>item 3</div>
+ </test-menu>
+ </test-menu>
+ </template>
+ </test-fixture>
+
<script>
suite('menu a11y tests', function() {
@@ -100,6 +111,36 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, 200);
});
+ test('keyboard events should not bubble', function(done) {
+ var menu = fixture('nested');
+ var keyCounter = 0;
+
+ menu.addEventListener('keydown', function(event) {
+ if (menu.keyboardEventMatchesKeys(event, 'esc')) {
+ keyCounter++;
+ }
+ if (menu.keyboardEventMatchesKeys(event, 'up')) {
+ keyCounter++;
+ }
+ if (menu.keyboardEventMatchesKeys(event, 'down')) {
+ keyCounter++;
+ }
+ });
+
+ // up
+ MockInteractions.keyDownOn(menu.firstElementChild, 38);
+ // down
+ MockInteractions.keyDownOn(menu.firstElementChild, 40);
+ // esc
+ MockInteractions.keyDownOn(menu.firstElementChild, 27);
+
+ setTimeout(function() {
+ assert.equal(menu.firstElementChild.tagName, 'TEST-MENU');
+ assert.equal(keyCounter, 0);
+ done();
+ }, 200);
+ });
+
});
</script>

Powered by Google App Engine
This is Rietveld 408576698