| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| let suite = InspectorTest.createAsyncSuite("CSS.StyleSheetEvents.InspectorStyleSheet"); |
| name: "CheckNoStyleSheets", |
| description: "Ensure there are currently no stylesheets.", |
| InspectorTest.expectThat(WI.cssStyleManager.styleSheets.length === 0, "Should be no stylesheets."); |
| name: "CreateInspectorStyleSheet", |
| description: "Creating an inspector stylesheet adds a stylesheet.", |
| WI.cssStyleManager.awaitEvent(WI.CSSStyleManager.Event.StyleSheetAdded) |
| InspectorTest.expectThat(WI.cssStyleManager.styleSheets.length === 1, "Should be one stylesheet."); |
| InspectorTest.assert(event.data.styleSheet instanceof WI.CSSStyleSheet, "Event data should be a CSSStyleSheet"); |
| InspectorTest.expectThat(event.data.styleSheet.origin === WI.CSSStyleSheet.Type.Inspector, "StyleSheet origin should be 'inspector'."); |
| CSSAgent.createStyleSheet(WI.frameResourceManager.mainFrame.id); |
| suite.runTestCasesAndFinish(); |
| <body onload="runTest()"> |
| <p>Test for CSS.styleSheetAdded for Inspector stylesheets.</p> |