3 <script src="../http/tests/inspector/inspector-test.js"></script>
8 function TestView(viewName, requiredCSS, requiredCSS2)
10 WebInspector.View.call(this);
12 this.registerRequiredCSS(requiredCSS);
14 this.registerRequiredCSS(requiredCSS2);
15 this._viewName = viewName;
18 TestView.prototype = {
19 show: function(parentElement)
21 InspectorTest.addResult(this._viewName + ".show()");
22 WebInspector.View.prototype.show.call(this, parentElement);
27 InspectorTest.addResult(this._viewName + ".detach()");
28 WebInspector.View.prototype.detach.call(this);
31 _doLoadCSS: function(cssFile)
33 InspectorTest.addResult(" LOAD " + cssFile);
36 _doUnloadCSS: function(cssFile)
38 InspectorTest.addResult(" UNLOAD " + cssFile);
42 TestView.prototype.__proto__ = WebInspector.View.prototype;
44 InspectorTest.runTestSuite([
45 function testEvents(next)
47 var parentView = new TestView("Parent", "parent.css");
48 parentView.show(WebInspector.inspectorView.element);
50 var childView1 = new TestView("Child 1", "child.css", "child1.css");
51 var childView2 = new TestView("Child 2", "child.css", "child2.css");
53 childView1.show(parentView.element);
54 childView2.show(parentView.element);
56 childView2.detach(parentView.element);
60 parentView.show(WebInspector.inspectorView.element);
70 <body onload="runTest()">
72 This tests that CSS files are properly loaded / unloaded upon view show / detach.