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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/shell/TestShell.js

Issue 2513423003: DevTools: Convert inspector-unit tests to use reusable test harness (Closed)
Patch Set: create shell module Created 4 years 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 unified diff | Download patch
OLDNEW
(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();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698