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

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

Issue 10545070: Make platform app restrictions more robust. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove debugging code Created 8 years, 6 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
« no previous file with comments | « chrome/renderer/resources/extensions/platform_app.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/platform_apps/restrictions/test.js
diff --git a/chrome/test/data/extensions/platform_apps/restrictions/test.js b/chrome/test/data/extensions/platform_apps/restrictions/test.js
index c8da9f9a2ad2cf603570b6751eed296da96fc95c..94fcfd1cad864bb13e04fc678ed244b493b8557f 100644
--- a/chrome/test/data/extensions/platform_apps/restrictions/test.js
+++ b/chrome/test/data/extensions/platform_apps/restrictions/test.js
@@ -33,12 +33,6 @@ chrome.test.runTests([
succeed();
},
- function testWindowHistoryOpen() {
- assertThrowsError(window.history.open);
- assertThrowsError(history.open);
- succeed();
- },
-
function testWindowHistoryBack() {
assertThrowsError(window.history.back);
assertThrowsError(history.back);
@@ -80,29 +74,45 @@ chrome.test.runTests([
},
function testWindowFind() {
+ assertThrowsError(Window.prototype.find);
assertThrowsError(window.find);
assertThrowsError(find);
succeed();
},
function testWindowAlert() {
+ assertThrowsError(Window.prototype.alert);
assertThrowsError(window.alert);
assertThrowsError(alert);
succeed();
},
function testWindowConfirm() {
+ assertThrowsError(Window.prototype.confirm);
assertThrowsError(window.confirm);
assertThrowsError(confirm);
succeed();
},
function testWindowPrompt() {
+ assertThrowsError(Window.prototype.prompt);
assertThrowsError(window.prompt);
assertThrowsError(prompt);
succeed();
},
+ function testBars() {
+ var bars = ['locationbar', 'menubar', 'personalbar',
+ 'scrollbars', 'statusbar', 'toolbar'];
+ for (var x = 0; x < bars.length; x++) {
+ assertThrowsError(function() {
+ var visible = this[bars[x]].visible;
+ visible = window[bars[x]].visible;
+ });
+ }
+ succeed();
+ },
+
function testBlockedEvents() {
var eventHandler = function() { fail('event handled'); };
var blockedEvents = ['unload', 'beforeunload'];
@@ -114,20 +124,12 @@ chrome.test.runTests([
assertThrowsError(function() {
window.addEventListener(blockedEvents[i], eventHandler);
});
- }
-
- succeed();
- },
-
- function testBars() {
- var bars = ['locationbar', 'menubar', 'personalbar',
- 'scrollbars', 'statusbar', 'toolbar'];
- for (var x = 0; x < bars.length; x++) {
assertThrowsError(function() {
- var visible = this[bars[x]].visible;
- visible = window[bars[x]].visible;
+ Window.prototype.addEventListener.apply(window,
+ [blockedEvents[i], eventHandler]);
});
}
+
succeed();
},
« no previous file with comments | « chrome/renderer/resources/extensions/platform_app.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698