Bug 97979 - Mixed content errors should contain stack traces when relevant.
Summary: Mixed content errors should contain stack traces when relevant.
Status: RESOLVED DUPLICATE of bug 100650
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mike West
URL:
Keywords:
Depends on: 45638 99857
Blocks: 97978
  Show dependency treegraph
 
Reported: 2012-09-30 12:39 PDT by Mike West
Modified: 2013-01-04 00:51 PST (History)
6 users (show)

See Also:


Attachments
WIP (2.95 KB, patch)
2012-10-19 08:33 PDT, Mike West
no flags Details | Formatted Diff | Diff
WIP (4.27 KB, patch)
2012-10-19 12:34 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch (8.51 KB, patch)
2012-10-20 07:11 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch (9.82 KB, patch)
2012-10-22 01:30 PDT, Mike West
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike West 2012-09-30 12:39:39 PDT
Currently, the mixed content errors we generate are of the form "The page at <url> displayed/ran insecure content from <url>." When relevant, we should attach a line number or stack trace to give some context.
Comment 1 Mike West 2012-10-19 08:33:09 PDT
Created attachment 169624 [details]
WIP
Comment 2 Mike West 2012-10-19 12:34:59 PDT
Created attachment 169673 [details]
WIP
Comment 3 Mike West 2012-10-19 12:43:29 PDT
Hello Inspector folks. :)

I'm having a hard time writing a test for this patch. It needs to run under HTTPS in order to generate a mixed content warning, but the simple redirect that works for other tests I've seen doesn't seem to work here. The test simply times out after redirecting.

Are there any HTTPS/inspector test limitations that you know of? Or am I just doing something obviously wrong in the attached patch? I've tried a few variations on the theme, but haven't yet been very successful. :/

Thanks!
Comment 4 Pavel Feldman 2012-10-19 12:59:35 PDT
Comment on attachment 169673 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=169673&action=review

Note that inspector harness is very sensitive wrt navigation. You should use InspectorTest.navigate from within inspector to navigate.

> LayoutTests/http/tests/inspector/mixedcontent-warning-contains-stacktrace.html:17
> +        <script src="/inspector/resources/csp-test.js"></script>

What is csp-test?
Comment 5 Mike West 2012-10-20 07:11:16 PDT
Created attachment 169768 [details]
Patch
Comment 6 Mike West 2012-10-20 07:38:25 PDT
(In reply to comment #5)
> Created an attachment (id=169768) [details]
> Patch

This patch's test should work correctly on mac. I'll have to wait till I'm back at the office to generate the Chromium linux baseline, as the inspector tests don't seem to work on Chromium mac. :(
Comment 7 WebKit Review Bot 2012-10-20 21:10:21 PDT
Comment on attachment 169768 [details]
Patch

Attachment 169768 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14457977

New failing tests:
http/tests/inspector/stacktraces/mixedcontent-warning-contains-stacktrace.html
Comment 8 Mike West 2012-10-22 01:30:32 PDT
Created attachment 169850 [details]
Patch
Comment 9 Mike West 2012-10-22 01:31:19 PDT
(In reply to comment #8)
> Created an attachment (id=169850) [details]
> Patch

This patch updates the Chromium expectations. Ideally, it'll make all the bots happy.
Comment 10 Pavel Feldman 2012-10-23 09:24:57 PDT
Comment on attachment 169850 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169850&action=review

> Source/WebCore/loader/MixedContentChecker.cpp:113
> +    console->addMessage(NetworkMessageSource, LogMessageType, WarningMessageLevel, message, m_frame->document()->url().string(), 0, callStack);

Why did you switch from HTML to network source?

> LayoutTests/http/tests/inspector/stacktraces/mixedcontent-warning-contains-stacktrace.html:8
> +    function test() {

Please place { on the next line. We also don't indent top-level functions.

> LayoutTests/http/tests/inspector/stacktraces/mixedcontent-warning-contains-stacktrace.html:11
> +        InspectorTest.navigate("https://127.0.0.1:8443/inspector/stacktraces/resources/mixedcontent-page.html", navigateBack);

Navigation is extremely fragile in the inspector harness, please open iframes whenever possible.
Comment 11 Mike West 2012-10-24 05:29:50 PDT
(In reply to comment #10)
> (From update of attachment 169850 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169850&action=review
> 
> > Source/WebCore/loader/MixedContentChecker.cpp:113
> > +    console->addMessage(NetworkMessageSource, LogMessageType, WarningMessageLevel, message, m_frame->document()->url().string(), 0, callStack);
> 
> Why did you switch from HTML to network source?

Mistake.That's leftover from earlier experimentation. I'll remove it when I respin the patch. 

> > LayoutTests/http/tests/inspector/stacktraces/mixedcontent-warning-contains-stacktrace.html:8
> > +    function test() {
> 
> Please place { on the next line. We also don't indent top-level functions.
> 
> > LayoutTests/http/tests/inspector/stacktraces/mixedcontent-warning-contains-stacktrace.html:11
> > +        InspectorTest.navigate("https://127.0.0.1:8443/inspector/stacktraces/resources/mixedcontent-page.html", navigateBack);
> 
> Navigation is extremely fragile in the inspector harness, please open iframes whenever possible.

I wasn't able to get this test working in an iframe. :/ I'll try again, but probably won't have time to fiddle until later this week.
Comment 12 Mike West 2012-11-30 12:20:02 PST
Closing this in favor of 100650, where I'm doing the same work in a more general way.

*** This bug has been marked as a duplicate of bug 100650 ***
Comment 13 Eric Seidel (no email) 2013-01-04 00:51:12 PST
Comment on attachment 169850 [details]
Patch

Cleared review? from attachment 169850 [details] so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).