Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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. | |
| 4 | |
| 5 Shell.TestShell = class { | |
| 6 /** | |
| 7 * @suppressGlobalPropertiesCheck | |
| 8 */ | |
| 9 constructor() { | |
| 10 if (self.document.readyState === 'complete' || self.document.readyState === 'interactive') | |
| 11 this.initializeUnitTest(); | |
| 12 else | |
| 13 document.addEventListener('DOMContentLoaded', () => this.initializeUnitTes t()); | |
|
dgozman
2016/11/30 18:19:54
There is runOnWindowLoad function in DOMExtension.
chenwilliam
2016/11/30 19:53:08
Done.
| |
| 14 } | |
| 15 | |
| 16 /** | |
| 17 * @suppressGlobalPropertiesCheck | |
| 18 */ | |
| 19 initializeUnitTest() { | |
| 20 var globalStorage = new Common.SettingsStorage( | |
| 21 {}, InspectorFrontendHost.setPreference, InspectorFrontendHost.removePre ference, | |
| 22 InspectorFrontendHost.clearPreferences); | |
| 23 var storagePrefix = ''; | |
| 24 var localStorage = new Common.SettingsStorage({}, undefined, undefined, unde fined, storagePrefix); | |
| 25 Common.settings = new Common.Settings(globalStorage, localStorage); | |
| 26 | |
| 27 UI.viewManager = new UI.ViewManager(); | |
| 28 UI.initializeUIUtils(document, Common.settings.createSetting('uiTheme', 'def ault')); | |
| 29 UI.installComponentRootStyles(/** @type {!Element} */ (document.body)); | |
| 30 | |
| 31 UI.zoomManager = new UI.ZoomManager(self, InspectorFrontendHost); | |
| 32 UI.inspectorView = UI.InspectorView.instance(); | |
| 33 UI.ContextMenu.initialize(); | |
| 34 UI.ContextMenu.installHandler(document); | |
| 35 UI.Tooltip.installHandler(document); | |
| 36 | |
| 37 var rootView = new UI.RootView(); | |
| 38 UI.inspectorView.show(rootView.element); | |
| 39 rootView.attachToDocument(document); | |
| 40 TestRunner.executeTestScript(); | |
| 41 } | |
| 42 }; | |
| 43 | |
| 44 new Shell.TestShell(); | |
| OLD | NEW |