Index: chrome/test/data/extensions/api_test/executescript/http204/background.js |
diff --git a/chrome/test/data/extensions/api_test/executescript/http204/background.js b/chrome/test/data/extensions/api_test/executescript/http204/background.js |
index 53e3fb98d4dcc4f0bd654cb28487e3a0df7f31f7..b085c5b8c021a8ca546ebe352742e31e2c77a41b 100644 |
--- a/chrome/test/data/extensions/api_test/executescript/http204/background.js |
+++ b/chrome/test/data/extensions/api_test/executescript/http204/background.js |
@@ -287,19 +287,33 @@ function checkManifestScriptsAfter204Navigation(tabId) { |
allFrames: true, |
code: '[' + |
'[window.documentStart,' + |
- ' window.documentEnd],' + |
+ ' window.documentEnd,' + |
+ ' performance.timing.domContentLoadedEventStart > 0],' + |
'[window.didRunAtDocumentStartUnexpected,' + |
' window.didRunAtDocumentEndUnexpected],' + |
']', |
}, chrome.test.callbackPass(function(results) { |
chrome.test.assertEq(2, results.length); |
// Main frame. Should not be affected by child frame navigations. |
- chrome.test.assertEq([[1, 1], [null, null]], results[0]); |
+ chrome.test.assertEq([[1, 1, true], [null, null]], results[0]); |
// Child frame. |
+ if (!results[1][0][2]) { // = if DOMContentLoaded did not run. |
+ // If the 204 reply was handled faster than the parsing of the frame |
+ // document, then the DOMContentLoaded event won't be triggered. |
+ chrome.test.assertEq([ |
+ // The 204 navigation was triggered by the page, so the document_start |
+ // script should have run by then. But since DOMContentLoaded is not |
+ // triggered, the document_end script should not run either. |
+ [1, null, false], |
+ // Should not inject non-matching scripts. |
+ [null, null], |
+ ], results[1]); |
+ return; |
+ } |
chrome.test.assertEq([ |
// Should run the content scripts even after a navigation to 204. |
- [1, 1], |
+ [1, 1, true], |
// Should not inject non-matching scripts. |
[null, null], |
], results[1]); |