Chromium Code Reviews| 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 | |
|
vsevik
2013/12/06 08:48:44
nit: extra line
Dmitry Zvorygin
2013/12/06 10:02:59
Done.
| |
| 23 runTest(); | |
| 24 } | |
| 25 | |
| 26 function test() | |
| 27 { | |
| 28 var messagesElement = WebInspector.consoleView.messagesElement; | |
| 29 | |
| 30 function dumpVisibleMessages() | |
| 31 { | |
| 32 var children = WebInspector.consoleView.topGroup.element.childNodes[0].c hildNodes; | |
| 33 | |
| 34 for (var i = 0; i < children.length; i++) | |
| 35 InspectorTest.addResult(">" + children[i].textContent); | |
| 36 } | |
| 37 | |
| 38 var testSuite = [ | |
| 39 function beforeFilter(next) | |
| 40 { | |
| 41 InspectorTest.addResult(arguments.callee.name); | |
| 42 dumpVisibleMessages(); | |
| 43 next(); | |
| 44 }, | |
|
vsevik
2013/12/06 08:48:44
nit: blank line between functions
Dmitry Zvorygin
2013/12/06 10:02:59
Done.
| |
| 45 function onlyWarning(next) | |
| 46 { | |
| 47 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("w arning"); | |
| 48 dumpVisibleMessages(); | |
| 49 next(); | |
| 50 }, | |
| 51 function onlyLog(next) | |
| 52 { | |
| 53 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("l og"); | |
| 54 dumpVisibleMessages(); | |
| 55 next(); | |
| 56 }, | |
| 57 function onlyErrorDebug(next) | |
| 58 { | |
| 59 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("e rror"); | |
| 60 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("d ebug", true); | |
| 61 dumpVisibleMessages(); | |
| 62 next(); | |
| 63 }, | |
| 64 function onlyAbcMessagePlain(next) | |
| 65 { | |
| 66 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter(We bInspector.NamedBitSetFilterUI.ALL_TYPES); | |
| 67 WebInspector.consoleView._filter._textFilterUI.setValue("abc"); | |
| 68 dumpVisibleMessages(); | |
| 69 next(); | |
| 70 }, | |
| 71 function onlyAbcMessageRegex(next) | |
| 72 { | |
| 73 WebInspector.consoleView._filter._textFilterUI._regexCheckBox.checke d = "checked"; | |
| 74 WebInspector.consoleView._filter._textFilterUI.setValue("ab[a-z]"); | |
| 75 dumpVisibleMessages(); | |
| 76 next(); | |
| 77 }, | |
| 78 function onlyAbcMessageRegexWarning(next) | |
| 79 { | |
| 80 WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("w arning", false); | |
| 81 dumpVisibleMessages(); | |
| 82 next(); | |
| 83 } | |
| 84 ] | |
| 85 | |
| 86 InspectorTest.evaluateInConsole("'Should be always visible'", InspectorTest. runTestSuite.bind(InspectorTest, testSuite)); | |
| 87 } | |
| 88 | |
| 89 </script> | |
| 90 </head> | |
| 91 | |
| 92 <body onload="onload()"> | |
| 93 <p> | |
| 94 Tests that console can filter messages by source. | |
| 95 </p> | |
| 96 | |
| 97 </body> | |
| 98 </html> | |
| OLD | NEW |