RESOLVED FIXED Bug 44092
Web Inspector: Add XMLHttpRequest Logging Tests
https://bugs.webkit.org/show_bug.cgi?id=44092
Summary Web Inspector: Add XMLHttpRequest Logging Tests
Joseph Pecoraro
Reported 2010-08-16 23:50:07 PDT
You can right click the console to Enable or Disable XMLHttpRequest Logging. Seemed like something easy to add tests for and relearn the inspector testing framework.
Attachments
[PATCH] Not Final - Has file:/// paths for my machine (4.93 KB, patch)
2010-08-16 23:54 PDT, Joseph Pecoraro
no flags
[PATCH] http/tests/inspector/console-xhr-logging.html (5.03 KB, patch)
2010-08-17 00:19 PDT, Joseph Pecoraro
pfeldman: review+
Joseph Pecoraro
Comment 1 2010-08-16 23:54:55 PDT
Created attachment 64553 [details] [PATCH] Not Final - Has file:/// paths for my machine When logging the results it should file:/// URLs. I was going to ask if there might be a way to trick this into giving http:// URLs, or if I am going to have to write my own dumpConsoleMessages that filters these URLs. I'll do this if there are no other suggestions. Thoughts?
Ilya Tikhonovsky
Comment 2 2010-08-17 00:10:20 PDT
Comment on attachment 64553 [details] [PATCH] Not Final - Has file:/// paths for my machine LayoutTests/inspector/console-xhr-logging-expected.txt:1 + ALERT: file:///Users/pecoraro_mbp/code/safari/OpenSource/LayoutTests/inspector/console-xhr-logging.html It would be better to move this test under http/tests and use http server. like LayoutTests/http/tests/inspector/change-iframe-src.html
Joseph Pecoraro
Comment 3 2010-08-17 00:12:56 PDT
> It would be better to move this test under http/tests and use http server. > like LayoutTests/http/tests/inspector/change-iframe-src.html Good point. I just figured that out myself =). I'll have another patch up in a second.
Joseph Pecoraro
Comment 4 2010-08-17 00:19:55 PDT
Created attachment 64554 [details] [PATCH] http/tests/inspector/console-xhr-logging.html
Ilya Tikhonovsky
Comment 5 2010-08-17 00:54:07 PDT
looks good to me
Pavel Feldman
Comment 6 2010-08-17 01:08:51 PDT
Comment on attachment 64554 [details] [PATCH] http/tests/inspector/console-xhr-logging.html Nice test, thanks for adding it! LayoutTests/http/tests/inspector/console-xhr-logging.html:11 + console.log(result); We use convenience output() method for dumping stuff into the page. It then gets into the results via the dump render tree standard logging in a much nicer way. LayoutTests/http/tests/inspector/console-xhr-logging.html:50 + if (WebInspector.monitoringXHREnabled) You could do this check earlier and not do waitUntilDone in this branch. LayoutTests/http/tests/inspector/console-xhr-logging.html:62 + if (!WebInspector.monitoringXHREnabled) Ditto.
Joseph Pecoraro
Comment 7 2010-08-17 09:41:48 PDT
> LayoutTests/http/tests/inspector/console-xhr-logging.html:11 > + console.log(result); > We use convenience output() method for dumping stuff into the page. > It then gets into the results via the dump render tree standard logging > in a much nicer way. In this case, console.log() is more desirable than output(), because the console.log() statements will show up in the console interleaved with the XHR requests, so you know if the logging happened during the enabled or disabled phases. Using output() puts the enabled / disabled / sending XHR output up top, and there is some logging from the console, but you won't know when it happened. > LayoutTests/http/tests/inspector/console-xhr-logging.html:50 > + if (WebInspector.monitoringXHREnabled) > You could do this check earlier and not do waitUntilDone in this branch. > > LayoutTests/http/tests/inspector/console-xhr-logging.html:62 > + if (!WebInspector.monitoringXHREnabled) > Ditto. Done. I moved the waitUntilDone later, and early return in these if statements.
Joseph Pecoraro
Comment 8 2010-08-17 15:37:23 PDT
Committed r65565 A LayoutTests/http/tests/inspector/console-xhr-logging.html A LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt A LayoutTests/http/tests/inspector/resources/xhr-exists.html M LayoutTests/ChangeLog r65565 = f61c044666da7dd0352ef21ec9e1f7e8c532d785 http://trac.webkit.org/changeset/65565
Note You need to log in before you can comment on or make changes to this bug.