| Index: chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/main.js
|
| diff --git a/chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/main.js b/chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/main.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..56d43dd89db915ea9e5b29f3119f1f50ece4a7af
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/main.js
|
| @@ -0,0 +1,49 @@
|
| +// Copyright 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.
|
| +
|
| +var LOG = function(msg) {
|
| + window.console.log(msg);
|
| +};
|
| +
|
| +var startTest = function() {
|
| + var webview = document.createElement('webview');
|
| + var onLoadStop = function(e) {
|
| + webview.contentWindow.postMessage(JSON.stringify(['connect']),'*');
|
| + };
|
| +
|
| + webview.addEventListener('loadstop', onLoadStop);
|
| + webview.addEventListener('consolemessage', function(e) {
|
| + LOG('g: ' + e.message);
|
| + });
|
| + webview.partition = 'partition1';
|
| + webview.style.width = '300px';
|
| + webview.style.height = '200px';
|
| + webview.style.margin = '0px';
|
| + webview.style.padding = '0px';
|
| + webview.style.position = 'absolute';
|
| + webview.style.left = '50px';
|
| + webview.style.top = '100px'
|
| + webview.src = 'guest.html';
|
| + document.querySelector('#webview-tag-container').appendChild(webview);
|
| +};
|
| +
|
| +window.addEventListener('message', function(e) {
|
| + var data = JSON.parse(e.data);
|
| + LOG('data: ' + data);
|
| + switch (data[0]) {
|
| + case 'connected':
|
| + chrome.test.sendMessage('WebViewTest.LAUNCHED');
|
| + break;
|
| + }
|
| +});
|
| +
|
| +if (chrome.test !== undefined) {
|
| + chrome.test.getConfig(function(config) {
|
| + startTest();
|
| + });
|
| +} else {
|
| + // Allow interactive debugging.
|
| + // Need timeout to allow the WebView prototype to be setup.
|
| + window.setTimeout(startTest, 100);
|
| +}
|
|
|