DescriptionFix an off-by-one error in checking # of action context menu items in
chrome.contextMenus.
We should not increment |num_items| if we're not adding the item to the
menu model. We have a test for this already:
ExtensionContextMenuModelTest::ExtensionItemTest, since that is looking
at |num_items| to verify
(by ExtensionContextMenuModelTest::CountExtensionItems()).
BUG=463467
Test=Add 6 browser_action items from an extension that has "contextMenus" permission:
for (var i = 0; i < chrome.contextMenus.ACTION_MENU_TOP_LEVEL_LIMIT; i++) {
(function(idx) {
chrome.contextMenus.create({ contexts: [ "browser_action" ], title: "entry " + idx }, function() {
console.debug("created " + idx, chrome.runtime.lastError);
})
})(i);
}
Expect all 6 (ACTION_MENU_TOP_LEVEL_LIMIT) items to show up when you right
click the extension icon in browser toolbar.
Committed: https://crrev.com/413226da7a9a50853005b83a440c8026f823163a
Cr-Commit-Position: refs/heads/master@{#329948}
Patch Set 1 #Patch Set 2 : add thorough test + git cl format #
Total comments: 1
Messages
Total messages: 9 (2 generated)
|