Create mochitests for more Mixed Content test cases
Categories
(Core :: DOM: Security, defect, P3)
Tracking
()
People
(Reporter: tanvi, Unassigned, Mentored)
References
(Blocks 2 open bugs)
Details
(Keywords: good-first-bug, Whiteboard: [domsecurity-backlog3])
Reporter | ||
Updated•10 years ago
|
Comment 1•10 years ago
|
||
Reporter | ||
Comment 2•10 years ago
|
||
Comment 3•9 years ago
|
||
Reporter | ||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Comment 6•9 years ago
|
||
Updated•9 years ago
|
Updated•9 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Comment 7•8 years ago
|
||
Comment 8•8 years ago
|
||
Comment 9•7 years ago
|
||
Reporter | ||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 13•6 years ago
|
||
Hi, is this issue still relevant?
I can try to tackle this :)
Reporter | ||
Comment 14•6 years ago
|
||
I'm not sure what is left here. Redirecting to Jonathan.
Comment 15•6 years ago
|
||
Hi Mariana,
Sorry for the delay. Yeah so this is still relevant, https://bugzilla.mozilla.org/show_bug.cgi?id=1039867#c11 outlines the tests that are still available. They need to be coded into web-platform-tests that we can automate them. As there are quite a lot I would create a patch for each test (at least to start with).
The code for mixed content web-platform-tests in firefox is stored here: https://searchfox.org/mozilla-central/source/testing/web-platform/tests/mixed-content if you check out firefox you can run these with ./mach test testing/web-platform/tests/mixed-content/img-tag/http-csp/same-host-https/top-level/no-redirect/allowed/allowed.https.html
on the command line for example.
Some of the tests look like they require disabling the protection and then navigating which would likely require a mozilla only check.
A good task to start with would be to categorise them into mochitest/wpt tests based on if they need UI work. Also checking if there is already overlap with existing tests too would be helpful. From there I can help with writing the tests.
Please let me know if there is anything I can help you with :)
Thanks
Jonathan
Comment 16•6 years ago
|
||
Hey Jonathan,
Thanks for the answer and for offering help. :)
So I'm confused about a few things... First, I'm not sure how to categorize them into mochitests or wpt tests. Mochitests are stuff that is automatically checked by the computer and wpt tests needs the interaction of an user? Would that be a good way to separate them?
Also, I was reading this article(https://developer.mozilla.org/en-US/docs/Mozilla/QA/web-platform-tests) and just to make sure, I should submit the patches here instead of the web-platform-tests github, right?
Thank you!
Comment 17•6 years ago
|
||
The separation is that both are very similar for use-cases. Where possible adding them as web-platform-tests is better however this is sometimes very difficult due to requiring interaction with the Browser UI.
By interaction I mean, the test will click on the shield (mixed content) icon and disable mixed content blocking, open another tab then click another link. Web platform tests can click on the content area but they are agnostic to browsers, so generally have no control over how the browser does things.
So in some of those tests there is a comment saying "click on the icon to disable", these are unlikely possible to make a web platform test without a lot of additional work. I suggest any tests that require anything other than typing an address into the URL bar should just be a mochitest.
Adding the web-platform-tests to mozilla source code will have it replicated onto github, so is likely easier here for these tests.
Comment 18•5 years ago
|
||
Sorry Jonathan, I started to classify the tests but I'm still confused about it. You said:
So in some of those tests there is a comment saying "click on the icon to disable", these are unlikely possible to make a web platform test without a lot of additional work. I suggest any tests that require anything other than typing an address into the URL bar should just be a mochitest.
Some tests like this one https://mixed-content-tests-mozilla.org/tvyas/mixeddocument4.html will show me text and won't ask me to deactivate secure connection, but it won't run the javascript code on its HTML. Here is the code for this test:
<!DOCTYPE html>
<html>
<head>
<script>
var txt="<!DOCTYPE html><html><body>Learning about the HTML DOM is fun!</body></html>";
document.write(txt);
document.open();
</script>
<script src = 'http://mixed-content-tests-mozilla.org/tvyas/script1.js'></script>
</head>
<body>
Hello There
</body>
</html>
Does that means that this is a web-platform-test? That's exactly what we're testing here, right? If we're in a secure connection than the code here http://mixed-content-tests-mozilla.org/tvyas/script1.js shouldn't run.
Sorry for asking this again, I just wanted to make sure!
And thanks for being so helpful Jonathan!
Comment 19•5 years ago
|
||
(In reply to Mariana Meireles from comment #18)
Does that means that this is a web-platform-test? That's exactly what we're testing here, right? If we're in a secure connection than the code here http://mixed-content-tests-mozilla.org/tvyas/script1.js shouldn't run.
Sorry for the delay. Yeah if the point is just to prevent scripts loading (I think there are some that are used this way with UI interaction though) then it's just a web platform test.
Some of these tests like this one in particular almost certainly have tests on web-platform-tests too.
All of these tests aren't unit tests, which are what we are looking for here. So for example https://mixed-content-tests-mozilla.org/tvyas/mixeddocument2.html instead of firing an alert should likely just call something to fail the test, the test should likely then wait for document load of the next page navigation.
Thank you for looking into this, having these as unit tests will ensure we are well tested on a fundamental part of the web platform.
Updated•5 years ago
|
Comment 20•4 years ago
|
||
This good-first-bug hasn't had any activity for 6 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Description
•