| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script src="resources/log-source.js"></script> |
| 6 <script> |
| 7 // Create a mix of log messages from different source files |
| 8 function onload() |
| 9 { |
| 10 console.info("sample info"); |
| 11 console.log("sample log"); |
| 12 console.warn("sample warning"); |
| 13 console.debug("sample debug"); |
| 14 console.error("sample error"); |
| 15 |
| 16 console.info("abc info"); |
| 17 console.info("def info"); |
| 18 |
| 19 console.warn("abc warn"); |
| 20 console.warn("def warn"); |
| 21 |
| 22 runTest(); |
| 23 } |
| 24 |
| 25 function test() |
| 26 { |
| 27 var messagesElement = WebInspector.consoleView.messagesElement; |
| 28 |
| 29 function dumpVisibleMessages() |
| 30 { |
| 31 var children = WebInspector.consoleView.topGroup.element.childNodes[0].c
hildNodes; |
| 32 |
| 33 for (var i = 0; i < children.length; i++) |
| 34 InspectorTest.addResult(">" + children[i].textContent); |
| 35 } |
| 36 |
| 37 var testSuite = [ |
| 38 function beforeFilter(next) |
| 39 { |
| 40 InspectorTest.addResult(arguments.callee.name); |
| 41 dumpVisibleMessages(); |
| 42 next(); |
| 43 }, |
| 44 |
| 45 function onlyWarning(next) |
| 46 { |
| 47 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("w
arning"); |
| 48 dumpVisibleMessages(); |
| 49 next(); |
| 50 }, |
| 51 |
| 52 function onlyLog(next) |
| 53 { |
| 54 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("l
og"); |
| 55 dumpVisibleMessages(); |
| 56 next(); |
| 57 }, |
| 58 |
| 59 function onlyErrorDebug(next) |
| 60 { |
| 61 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("e
rror"); |
| 62 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("d
ebug", true); |
| 63 dumpVisibleMessages(); |
| 64 next(); |
| 65 }, |
| 66 |
| 67 function onlyAbcMessagePlain(next) |
| 68 { |
| 69 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter(We
bInspector.NamedBitSetFilterUI.ALL_TYPES); |
| 70 WebInspector.consoleView._filter._textFilterUI.setValue("abc"); |
| 71 dumpVisibleMessages(); |
| 72 next(); |
| 73 }, |
| 74 |
| 75 function onlyAbcMessageRegex(next) |
| 76 { |
| 77 WebInspector.consoleView._filter._textFilterUI._regexCheckBox.checke
d = "checked"; |
| 78 WebInspector.consoleView._filter._textFilterUI.setValue("ab[a-z]"); |
| 79 dumpVisibleMessages(); |
| 80 next(); |
| 81 }, |
| 82 |
| 83 function onlyAbcMessageRegexWarning(next) |
| 84 { |
| 85 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("w
arning", false); |
| 86 dumpVisibleMessages(); |
| 87 next(); |
| 88 } |
| 89 ] |
| 90 |
| 91 InspectorTest.evaluateInConsole("'Should be always visible'", InspectorTest.
runTestSuite.bind(InspectorTest, testSuite)); |
| 92 } |
| 93 |
| 94 </script> |
| 95 </head> |
| 96 |
| 97 <body onload="onload()"> |
| 98 <p> |
| 99 Tests that console can filter messages by source. |
| 100 </p> |
| 101 |
| 102 </body> |
| 103 </html> |
| OLD | NEW |