1 // Copyright (c) 2012 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.
5 // NOTE: Some of the test code was put in the global scope on purpose!
7 var resultFromToolbarGetterAtStart = window.toolbar;
9 // The following statement implicitly invokes the window.toolbar setter. This
10 // should delete the "disabler" getter and setter that were set up in
11 // chrome/renderer/resources/extensions/platform_app.js, and restore normal
12 // getter/setter behaviors from here on.
13 var toolbar = {blah: 'glarf'};
15 var resultFromToolbarGetterAfterRedefinition = window.toolbar;
16 var toolbarIsWindowToolbarAfterRedefinition = (toolbar === window.toolbar);
20 chrome.app.runtime.onLaunched.addListener(function() {
21 chrome.test.assertEq('undefined', typeof(resultFromToolbarGetterAtStart));
22 chrome.test.assertEq('object',
23 typeof(resultFromToolbarGetterAfterRedefinition));
24 chrome.test.assertTrue(toolbarIsWindowToolbarAfterRedefinition);
26 chrome.test.assertEq('baz', toolbar.blah);
28 chrome.test.notifyPass();