OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var startTest = function() { |
| 6 var iframe = document.querySelector('iframe'); |
| 7 var iframeWindow = iframe.contentWindow; |
| 8 iframe.addEventListener('load', function(e) { |
| 9 iframeWindow.document.querySelector('#webview-tag-container').innerHTML = |
| 10 '<webview></webview>'; |
| 11 var webview = iframeWindow.document.querySelector('webview'); |
| 12 webview.addEventListener('loadstop', function(e) { |
| 13 if (!webview.contentWindow) { |
| 14 chrome.test.sendMessage('FAILURE'); |
| 15 return; |
| 16 } |
| 17 chrome.test.sendMessage('LAUNCHED'); |
| 18 }); |
| 19 webview.src = 'data:text/html,<body>Guest</body>'; |
| 20 }); |
| 21 iframe.src = 'webview.html'; |
| 22 }; |
| 23 |
| 24 window.onload = startTest; |
OLD | NEW |