Bug 1416039 - Fix intermittent browser_ext_tabs_lastAccessed.js, r?mixedpuppy draft
authorBob Silverberg <bsilverberg@mozilla.com>
Fri, 24 Nov 2017 08:26:34 -0500
changeset 703183 c5ab31065ea6f1de2fa026b7134c42d14d634851
parent 703179 f2e36fbb90fad27c034105709a4cbbaef9bd58c8
child 741691 64dc70b8bc3a73273421e12b6db994368acbf902
push id90733
push userbmo:bob.silverberg@gmail.com
push dateFri, 24 Nov 2017 13:27:05 +0000
reviewersmixedpuppy
bugs1416039
milestone59.0a1
Bug 1416039 - Fix intermittent browser_ext_tabs_lastAccessed.js, r?mixedpuppy The recent failures all seem to be on the assertion that lastAccessed of tab 1 is later than the test start time. It's possible that things happen so quickly that lastAccessed of tab 1 is the same as the start time, so this patch changes the comparison to be a <=. MozReview-Commit-ID: 67CVQPj1ShM
browser/components/extensions/test/browser/browser_ext_tabs_lastAccessed.js
--- a/browser/components/extensions/test/browser/browser_ext_tabs_lastAccessed.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_lastAccessed.js
@@ -16,17 +16,17 @@ add_task(async function testLastAccessed
       browser.test.onMessage.addListener(async function(msg, past) {
         let [tab1] = await browser.tabs.query({url: "https://example.com/?1"});
         let [tab2] = await browser.tabs.query({url: "https://example.com/?2"});
 
         browser.test.assertTrue(tab1 && tab2, "Expected tabs were found");
 
         let now = Date.now();
 
-        browser.test.assertTrue(past < tab1.lastAccessed,
+        browser.test.assertTrue(past <= tab1.lastAccessed,
                                 "lastAccessed of tab 1 is later than the test start time.");
         browser.test.assertTrue(tab1.lastAccessed < tab2.lastAccessed,
                                 "lastAccessed of tab 2 is later than lastAccessed of tab 1.");
         browser.test.assertTrue(tab2.lastAccessed <= now,
                                 "lastAccessed of tab 2 is earlier than now.");
 
         await browser.tabs.remove([tab1.id, tab2.id]);