Index: chrome/test/data/extensions/platform_apps/web_view/shim/parent_frame.html |
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/parent_frame.html b/chrome/test/data/extensions/platform_apps/web_view/shim/parent_frame.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e32310431566cc93b62f786b1ec76ca801f6929d |
--- /dev/null |
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/parent_frame.html |
@@ -0,0 +1,35 @@ |
+<!-- |
+ * Copyright (c) 2015 The Chromium Authors. All rights reserved. Use of this |
+ * source code is governed by a BSD-style license that can be found in the |
+ * LICENSE file. |
+--> |
+<body> |
+ <iframe></iframe> |
+ <script> |
+ var frame = document.querySelector('iframe'); |
+ var port = null; |
+ var seenRequest = false; |
+ |
+ // Message arrives from <webview>. |
+ window.onmessage = function(e) { |
+ seenRequest = true; |
+ port = e.source; |
+ if (e.data == 'load-frames') { |
+ // Start loading the iframe. |
+ frame.src = 'child_frame.html'; |
+ } |
+ }; |
+ |
+ frame.onload = function() { |
+ if (seenRequest) { |
+ var childFrame = |
+ frame.contentWindow.document.getElementById('child-frame'); |
+ childFrame.onload = function() { |
+ port.postMessage('frames-loaded', '*'); |
+ }; |
+ // Load the nested iframe. |
+ childFrame.src = 'data:text/html,Hello'; |
+ } |
+ }; |
+ </script> |
+</body> |