Index: chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js |
diff --git a/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js b/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js |
index aaec95845229d77a7539838551ea3d89c202f9dc..e6db6c5f0774d8ba3f30280f703d3c54bf0f9596 100644 |
--- a/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js |
+++ b/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js |
@@ -2,4 +2,9 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-chrome.extension.sendRequest(window.parent === window ? "parent" : "child"); |
+// Use onload event to make sure that the messages are first dispatched in |
+// frames, and then in the top-level frame. This requires document_start or |
+// document_end. |
+window.addEventListener('load', function() { |
+ chrome.extension.sendRequest(window.parent === window ? 'parent' : 'child'); |
+}); |