Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
[MD Extensions]: Fix sidebar icons
Browse files Browse the repository at this point in the history
sidebar.html relied on iron-icons but didn't include them. Add the
missing import and a general regression test.

BUG=529395
BUG=609424
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/1951323002
Cr-Commit-Position: refs/heads/master@{#391905}
  • Loading branch information
rdcronin authored and Commit bot committed May 5, 2016
1 parent ffd6d84 commit 9ad53bd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions chrome/browser/resources/md_extensions/detail_view.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/resources/md_extensions/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-menu.html">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ cr.define('extension_detail_view_tests', function() {

test(assert(TestNames.Layout), function() {
Polymer.dom.flush();

extension_test_util.testIronIcons(item);

var testIsVisible = extension_test_util.isVisible.bind(null, item);
expectTrue(testIsVisible('#close-button'));
expectTrue(testIsVisible('#open-in-webstore'));
Expand Down
2 changes: 2 additions & 0 deletions chrome/test/data/webui/extensions/extension_sidebar_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ cr.define('extension_sidebar_tests', function() {
});

test(assert(TestNames.Layout), function() {
extension_test_util.testIronIcons(sidebar);

var testVisible = extension_test_util.testVisible.bind(null, sidebar);
testVisible('#load-unpacked', false);
testVisible('#pack-extensions', false);
Expand Down
14 changes: 14 additions & 0 deletions chrome/test/data/webui/extensions/extension_test_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,25 @@ cr.define('extension_test_util', function() {
}, opt_properties);
}

/**
* Tests that any iron-icon child of an HTML element has a corresponding
* non-empty svg element.
* @param {HTMLElement} e The element to check the iron icons in.
*/
function testIronIcons(e) {
e.querySelectorAll('* /deep/ iron-icon').forEach(function(icon) {
var svg = icon.$$('svg');
expectTrue(!!svg && svg.innerHTML != '',
'icon "' + icon.icon + '" is not present');
});
}

return {
ClickMock: ClickMock,
MockItemDelegate: MockItemDelegate,
isVisible: isVisible,
testVisible: testVisible,
createExtensionInfo: createExtensionInfo,
testIronIcons: testIronIcons,
};
});

0 comments on commit 9ad53bd

Please sign in to comment.