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

Unified Diff: chrome/test/data/extensions/platform_apps/disabled_window_properties/test.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/disabled_window_properties/test.js
diff --git a/chrome/test/data/extensions/platform_apps/disabled_window_properties/test.js b/chrome/test/data/extensions/platform_apps/disabled_window_properties/test.js
index 759c208bf40680156a62610baf229d20d3beda50..572cbb9a17b1656de3002dcc0fe81126b3b4cccb 100644
--- a/chrome/test/data/extensions/platform_apps/disabled_window_properties/test.js
+++ b/chrome/test/data/extensions/platform_apps/disabled_window_properties/test.js
@@ -4,19 +4,7 @@
// NOTE: Some of the test code was put in the global scope on purpose!
-function useToolbarGetter() {
- var result;
- try {
- // The following will invoke the window.toolbar getter, and this may or may
- // not throw an exception.
- result = {object: window.toolbar};
- } catch (e) {
- result = {exception: e};
- }
- return result;
-}
-
-var resultFromToolbarGetterAtStart = useToolbarGetter();
+var resultFromToolbarGetterAtStart = window.toolbar;
// The following statement implicitly invokes the window.toolbar setter. This
// should delete the "disabler" getter and setter that were set up in
@@ -24,17 +12,15 @@ var resultFromToolbarGetterAtStart = useToolbarGetter();
// getter/setter behaviors from here on.
var toolbar = {blah: 'glarf'};
-var resultFromToolbarGetterAfterRedefinition = useToolbarGetter();
+var resultFromToolbarGetterAfterRedefinition = window.toolbar;
var toolbarIsWindowToolbarAfterRedefinition = (toolbar === window.toolbar);
toolbar.blah = 'baz';
chrome.app.runtime.onLaunched.addListener(function() {
- chrome.test.assertTrue(
- resultFromToolbarGetterAtStart.hasOwnProperty('exception'));
-
- chrome.test.assertTrue(
- resultFromToolbarGetterAfterRedefinition.hasOwnProperty('object'));
+ chrome.test.assertEq('undefined', typeof(resultFromToolbarGetterAtStart));
+ chrome.test.assertEq('object',
+ typeof(resultFromToolbarGetterAfterRedefinition));
chrome.test.assertTrue(toolbarIsWindowToolbarAfterRedefinition);
chrome.test.assertEq('baz', toolbar.blah);
« no previous file with comments | « chrome/renderer/resources/extensions/platform_app.js ('k') | chrome/test/data/extensions/platform_apps/restrictions/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698