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.
5 var LOG = function(msg) {
6 window.console.log(msg);
9 var startTest = function() {
10 var webview = document.querySelector('webview');
11 var onLoadStop = function(e) {
12 webview.contentWindow.postMessage(JSON.stringify(['connect']),'*');
15 webview.addEventListener('loadstop', onLoadStop);
16 webview.addEventListener('consolemessage', function(e) {
17 LOG('g: ' + e.message);
19 webview.partition = 'partition1';
20 webview.src = 'guest.html';
23 window.addEventListener('message', function(e) {
24 var data = JSON.parse(e.data);
28 chrome.test.sendMessage('LAUNCHED');
30 case 'installed-touch-handler':
31 case 'uninstalled-touch-handler':
32 chrome.test.sendMessage(data[0]);
37 chrome.test.getConfig(function(config) {
38 var guestURL = 'data:text/html,<html><body>foo</body></html>';
39 document.querySelector('#webview-tag-container').innerHTML =
40 '<webview style="width: 10px; height: 10px; margin: 0; padding: 0;"' +