Unreviewed, GTK css2.1 rebaseline after r101343.
[WebKit-https.git] / LayoutTests / inspector / view-css.html
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 function test()
7 {
8     function TestView(viewName, requiredCSS, requiredCSS2)
9     {
10         WebInspector.View.call(this);
11
12         this.registerRequiredCSS(requiredCSS);
13         if (requiredCSS2)
14             this.registerRequiredCSS(requiredCSS2);
15         this._viewName = viewName;
16     }
17
18     TestView.prototype = {
19         show: function(parentElement)
20         {
21             InspectorTest.addResult(this._viewName + ".show()");
22             WebInspector.View.prototype.show.call(this, parentElement);
23         },
24
25         detach: function()
26         {
27             InspectorTest.addResult(this._viewName + ".detach()");
28             WebInspector.View.prototype.detach.call(this);
29         },
30
31         _doLoadCSS: function(cssFile)
32         {
33             InspectorTest.addResult("  LOAD " + cssFile);
34         },
35
36         _doUnloadCSS: function(cssFile)
37         {
38             InspectorTest.addResult("  UNLOAD " + cssFile);
39         }
40     };
41
42     TestView.prototype.__proto__ = WebInspector.View.prototype;
43
44     InspectorTest.runTestSuite([
45         function testEvents(next)
46         {
47             var parentView = new TestView("Parent", "parent.css");
48             parentView.show(WebInspector.inspectorView.element);
49
50             var childView1 = new TestView("Child 1", "child.css", "child1.css");
51             var childView2 = new TestView("Child 2", "child.css", "child2.css");
52
53             childView1.show(parentView.element);
54             childView2.show(parentView.element);
55
56             childView2.detach(parentView.element);
57
58             parentView.detach();
59
60             parentView.show(WebInspector.inspectorView.element);
61
62             next();
63         }
64     ]);
65 }
66
67 </script>
68 </head>
69
70 <body onload="runTest()">
71 <p>
72 This tests that CSS files are properly loaded / unloaded upon view show / detach.
73 </p>
74
75 </body>
76 </html>