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

Unified Diff: chrome/test/data/extensions/platform_apps/leave_fullscreen/main.js

Issue 306823002: Flip --enable-apps-show-on-first-paint flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/platform_apps/leave_fullscreen/main.js
diff --git a/chrome/test/data/extensions/platform_apps/leave_fullscreen/main.js b/chrome/test/data/extensions/platform_apps/leave_fullscreen/main.js
index 95940b1c3f67c163a0088d040af1dc6863aaaf7d..38a72b69dd0e1dd94a4245fa4e51d7d8ba4429b5 100644
--- a/chrome/test/data/extensions/platform_apps/leave_fullscreen/main.js
+++ b/chrome/test/data/extensions/platform_apps/leave_fullscreen/main.js
@@ -4,35 +4,37 @@
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('main.html', {}, function(win) {
- // The following key events handler should have no effect because the
- // application does not have the 'overrideEscFullscreen' permission.
- win.contentWindow.document.addEventListener('keydown', function(e) {
- e.preventDefault();
- });
- win.contentWindow.document.addEventListener('keyup', function(e) {
- e.preventDefault();
- });
-
- chrome.test.sendMessage('Launched', function(reply) {
+ win.onWindowFirstShown.addListener(function() {
+ // The following key events handler should have no effect because the
+ // application does not have the 'overrideEscFullscreen' permission.
win.contentWindow.document.addEventListener('keydown', function(e) {
- if (e.keyCode != 90) // 'z'
- return;
-
- chrome.test.sendMessage('KeyReceived');
+ e.preventDefault();
});
+ win.contentWindow.document.addEventListener('keyup', function(e) {
+ e.preventDefault();
+ });
+
+ chrome.test.sendMessage('Launched', function(reply) {
+ win.contentWindow.document.addEventListener('keydown', function(e) {
+ if (e.keyCode != 90) // 'z'
+ return;
- switch (reply) {
- case 'window':
- win.fullscreen();
- break;
- case 'dom':
- win.contentWindow.document.addEventListener('keydown', function() {
- win.contentWindow.document.removeEventListener('keydown',
- arguments.callee);
- win.contentWindow.document.body.webkitRequestFullscreen();
- });
- break;
- }
+ chrome.test.sendMessage('KeyReceived');
+ });
+
+ switch (reply) {
+ case 'window':
+ win.fullscreen();
+ break;
+ case 'dom':
+ win.contentWindow.document.addEventListener('keydown', function() {
+ win.contentWindow.document.removeEventListener('keydown',
+ arguments.callee);
+ win.contentWindow.document.body.webkitRequestFullscreen();
+ });
+ break;
+ }
+ });
});
});
});

Powered by Google App Engine
This is Rietveld 408576698