Chrome Version: 68.0.3440.106
OS: Lubuntu 18.04 LTS
What steps will reproduce the problem?
Run this code in an extension:
new Promise((resolve) => {
chrome.windows.create({url: "about:blank?1"}, ({id: windowId}) => {
chrome.tabs.create({url: "about:blank?2", windowId}, () => {
chrome.tabs.create({url: "about:blank?3", windowId}, ({id}) => {
chrome.tabs.highlight({tabs: [2, 0, 1], windowId}, () => {
chrome.windows.create({tabId: id}, () => {
chrome.tabs.query({highlighted: true, windowId}, ({length}) => {
console.log("Test 1 - Highlighted tabs:", length);
chrome.windows.remove(windowId, () => {
chrome.tabs.remove(id, resolve);
});
});
});
});
});
});
});
}).then(() => new Promise((resolve) => {
chrome.windows.create({url: "about:blank?1"}, ({id: windowId}) => {
chrome.tabs.create({url: "about:blank?2", windowId}, ({id}) => {
chrome.tabs.highlight({tabs: [0, 1], windowId}, () => {
chrome.tabs.update(id, {active: true}, () => {
chrome.tabs.query({highlighted: true, windowId}, ({length}) => {
console.log("Test 2 - Highlighted tabs:", length);
chrome.windows.remove(windowId, resolve);
});
});
});
});
});
}));
What is the expected result?
Both tests change the selected tab in a window, so they should be consistent with the clearance of the highlighted tabs.
What happens instead?
Test 1 does not clear the highlighted tabs (it gets 2 of them at the end) and test 2 does (it only gets 1, the selected tab).
Both tests get 1 highlighted tab in Firefox, see https://bugzil.la/1481185