Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/display_none_and_back/main.js

Issue 618823002: GuestView: Move lifetime management out of content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 LOG = function(msg) {
6 window.console.log(msg);
7 };
8
9 var failTest = function() {
10 chrome.test.sendMessage('WebViewTest.FAILURE');
11 };
12
13 var firstTime = true;
14
15 var startTest = function() {
16 document.querySelector('#webview-tag-container').innerHTML =
17 '<webview style="width: 10px; height: 10px; margin: 0; padding: 0;"' +
18 '></webview>';
19
20 var webview = document.querySelector('webview');
21 var onLoadStop = function(e) {
22 if (firstTime) {
23 firstTime = false;
24 chrome.test.sendMessage('WebViewTest.LAUNCHED');
25 } else {
26 chrome.test.sendMessage('WebViewTest.PASSED');
27 }
28 };
29
30 webview.addEventListener('loadstop', onLoadStop);
31 webview.src = 'data:text/html,<body>Guest</body>';
32 };
33
34 window.onAppCommand = function(command) {
35 LOG('onAppCommand: ' + command);
36 switch (command) {
37 case 'hide-guest':
38 document.querySelector('webview').style.display = 'none';
39 break;
40 case 'show-guest':
41 document.querySelector('webview').style.display = '';
42 break;
43 default:
44 failTest();
45 break;
46 }
47 };
48
49 window.onload = startTest;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698