3 <link rel=
"stylesheet" href=
"./resources/empty.css">
4 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
5 <script src=
"../../http/tests/inspector/debugger-test.js"></script>
6 <script src=
"./autocomplete-test.js"></script>
7 <script src=
"../editor/editor-test.js"></script>
11 InspectorTest
.showScriptSource("empty.css", onSourceFrame
);
15 function onSourceFrame(sourceFrame
)
17 textEditor
= sourceFrame
.textEditor
;
18 dumpSuggestions
= InspectorTest
.dumpSuggestions
.bind(InspectorTest
, textEditor
);
19 InspectorTest
.runTestSuite(testSuite
);
23 function testClassNameAutocomplete(next
)
26 ".red { color: red }",
27 ".blue { color: blue }",
33 function testPropertyNameAutocomplete(next
)
36 ".red { color: red }",
40 ".my-class { -|webkit-border: 1px solid black; -webkit-color: blue;",
46 function testPropertyValueAutocomplete(next
)
49 ".red { border-style: |",
50 "/* some other words to mess up */"
53 ".red { border-style: d|",
54 "/* dial drummer dig */"
57 ".red { border-style: z|",
58 "/* zipper zorro zion */"
61 ".red { border-style/* comment */: /* comment */|"
64 ".my-class { -webkit-border: 1px solid black; -webkit-color: blue;",
70 function verifySuggestionsOnColumnTypedIn(next
)
72 textEditor
.element
.focus();
77 textEditor
.setSelection(WebInspector
.TextRange
.createFromLocation(1, 10));
78 InspectorTest
.dumpTextWithSelection(textEditor
);
80 InspectorTest
.addSniffer(WebInspector
.TextEditorAutocompleteController
.prototype, "_onSuggestionsShownForTest", function(words
) { suggestions
= words
; });
81 InspectorTest
.addSniffer(WebInspector
.TextEditorAutocompleteController
.prototype, "autocomplete", onTypedIn
);
82 InspectorTest
.typeIn(textEditor
, ":");
86 InspectorTest
.addResult("Suggestions displayed on ':' symbol typed in:");
87 InspectorTest
.addResult("[" + suggestions
.join(", ") + "]");
96 <body onload=
"runTest();">
98 The test verifies autocomplete suggestions for CSS file.