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

Unified Diff: chrome/test/data/webui/settings/site_list_tests.js

Issue 2230513003: [MD settings] setup site settings menus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes Created 4 years, 4 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 | « chrome/browser/resources/settings/site_settings/site_list.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/site_list_tests.js
diff --git a/chrome/test/data/webui/settings/site_list_tests.js b/chrome/test/data/webui/settings/site_list_tests.js
index 8e48d95f14934c86802513753ca3cc8ef1a1beac..ee830ce72d8e57ce9c10caac16f84f387a010124 100644
--- a/chrome/test/data/webui/settings/site_list_tests.js
+++ b/chrome/test/data/webui/settings/site_list_tests.js
@@ -268,15 +268,22 @@ cr.define('site_list', function() {
});
/**
+ * Fetch the non-hidden menu items from the list.
+ * @param {!HTMLElement} parentElement
+ */
+ function getMenuItems(listContainer) {
+ return listContainer.children[0].querySelectorAll(
+ 'paper-menu-button paper-item:not([hidden])');
+ }
+
+ /**
* Asserts the menu looks as expected.
* @param {Array<string>} items The items expected to show in the menu.
* @param {!HTMLElement} parentElement The parent node to start looking
* in.
*/
function assertMenu(items, parentElement) {
- var listItem = parentElement.$.listContainer.children[0];
- var menuItems = listItem.querySelectorAll(
- 'paper-menu-button paper-item:not([hidden])');
+ var menuItems = getMenuItems(parentElement.$.listContainer);
assertEquals(items.length, menuItems.length);
for (var i = 0; i < items.length; i++)
assertEquals(items[i], menuItems[i].textContent.trim());
@@ -641,6 +648,20 @@ cr.define('site_list', function() {
// No further checks needed. If this fails, it will hang the test.
});
});
+
+ test('Select menu item', function() {
+ // Test for error: "Cannot read property 'origin' of undefined".
+ setupCategory(settings.ContentSettingsTypes.GEOLOCATION,
+ settings.PermissionValues.ALLOW, prefs);
+ return browserProxy.whenCalled('getExceptionList').then(function(
+ contentType) {
+ Polymer.dom.flush();
+ var menuItems = getMenuItems(testElement.$.listContainer);
+ assertTrue(!!menuItems);
+ MockInteractions.tap(menuItems[0]);
+ return browserProxy.whenCalled('setCategoryPermissionForOrigin');
+ });
+ });
});
}
return {
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_list.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698