Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to change page zoom from tests. #15806

Open
emilio opened this issue Mar 3, 2017 · 1 comment · May be fixed by #15825
Open

Add an API to change page zoom from tests. #15806

emilio opened this issue Mar 3, 2017 · 1 comment · May be fixed by #15825

Comments

@emilio
Copy link
Member

@emilio emilio commented Mar 3, 2017

Right now we have tests for viewport resizing, but those are done via iframes and end up being intermittents easily.

We should add an API to modify the page zoom factor to TestBinding.webidl, which can be done programatically easily.

When that's done, we can land the test from #15801, with something as follows:

<!DOCTYPE html>
<style type="text/css">
	div {
		position: absolute;
		width: 80%;
		left: 10%;
		height: 100px;
		background: red;
	}
</style>
<div></div>
<script>
window.onload = function() {
    (new TestBinding()).setZoomFactor(1.5);
    document.body.offsetHeight;
}
</script>

(And an appropriate reftest).

For examples on how to add a testing API to TestBinding, you can see #12392.

For changing the page zoom, we may want to replicate the whole API that goes through the compositor, but the easiest way is to send the equivalent to synchronously call handle_resize_event with the test data in order to update the window_size field.

I'm willing to mentor this. A decent amount of experience or willingness to learn is needed.

@ferjm
Copy link
Member

@ferjm ferjm commented Mar 3, 2017

/me wants to learn :) I'll bug you on IRC as soon as I am blocked.

@ferjm ferjm self-assigned this Mar 3, 2017
@ferjm ferjm added the C-assigned label Mar 3, 2017
@ferjm ferjm linked a pull request that will close this issue Mar 5, 2017
4 of 4 tasks complete
bors-servo added a commit that referenced this issue Mar 8, 2017
…r=emilio

Add an API to change page zoom from tests

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15806
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15825)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Mar 9, 2017
…r=emilio

Add an API to change page zoom from tests

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15806
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15825)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Mar 9, 2017
…r=emilio

Add an API to change page zoom from tests

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15806
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15825)
<!-- Reviewable:end -->
@jdm jdm added the C-has open PR label Mar 18, 2017
@ferjm ferjm removed their assignment Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.