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

Unified Diff: chrome/test/data/extensions/platform_apps/restrictions/sandboxed_iframe.js

Issue 120733003: Feature detection-friendly restrictions for packaged apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback. Created 6 years, 11 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/restrictions/sandboxed_iframe.js
diff --git a/chrome/test/data/extensions/platform_apps/restrictions/sandboxed_iframe.js b/chrome/test/data/extensions/platform_apps/restrictions/sandboxed_iframe.js
index 08893bbffa334354c26ed7aa45f7eeb29ce01bb7..a71bc9f43403dc615002ddb34330594e42efa299 100644
--- a/chrome/test/data/extensions/platform_apps/restrictions/sandboxed_iframe.js
+++ b/chrome/test/data/extensions/platform_apps/restrictions/sandboxed_iframe.js
@@ -3,17 +3,16 @@
// found in the LICENSE file.
window.onload = function() {
- try {
- window.alert('should throw');
+ window.onunload = function() {
window.parent.postMessage({'success': false,
- 'reason' : 'should have thrown'},
+ 'reason' : 'unload handler works'},
'*');
- } catch(e) {
- var message = e.message || e;
- var succ = message.indexOf('is not available in packaged apps') != -1;
- window.parent.postMessage({'success': succ,
- 'reason' : 'got wrong error: ' + message},
+ };
+ if (typeof(window.unload) !== 'undefined') {
+ window.parent.postMessage({'success': false,
+ 'reason' : 'unload is not undefined'},
'*');
-
}
+ window.dispatchEvent(new Event('unload'));
+ window.parent.postMessage({'success': true}, '*');
};

Powered by Google App Engine
This is Rietveld 408576698