Bug 1568673 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I'm planning on adding an assertion to `ClampZoom()` here.

That should give us coverage, because here are all the places where we give `newZoom` a value:
 (1)      `newZoom = Some(defaultZoom);`
... and here, the `defaultZoom`  value comes from either:
 - a ClampZoom(...) call (where I'm adding an assertion)
 - or from an `aViewportInfo.GetDefaultZoom()` call (which is already checked via an assertion from Bug 1566991)
 - or from `intrinsicScale` whose value comes from `ComputeIntrinsicScale(...)` which calls `ClampZoom(...)` before returning (and I'm adding an assertion to `ClampZoom()` as noted above.

 (2) `newZoom = Some(ClampZoom(adjustedZoom, aViewportInfo));
... and here, this will be trivially checked via the assertion I'm adding in `ClampZoom`.

 (3) `newZoom = Some(intrinsicScale);`
...and `intrinsicScale` will be indirectly checked via my new `ClampZoom` assertion.

 (4)  `newZoom = Some(clampedZoom);`
...where `clampedZoom` is the result of a `ClampZoom()` call and hence will be checked via my new assertion.
I'm planning on adding an assertion to `ClampZoom()` here.

That should give us coverage, because here are all the places where we give `newZoom` a value:
 (1)      `newZoom = Some(defaultZoom);`
... and here, the `defaultZoom`  value comes from either:
 - a ClampZoom(...) call (where I'm adding an assertion)
 - or from an `aViewportInfo.GetDefaultZoom()` call (which is already checked via an assertion from Bug 1566991)
 - or from `intrinsicScale` whose value comes from `ComputeIntrinsicScale(...)` which calls `ClampZoom(...)` before returning (and I'm adding an assertion to `ClampZoom()` as noted above.

 (2) `newZoom = Some(ClampZoom(adjustedZoom, aViewportInfo));`
... and here, this will be trivially checked via the assertion I'm adding in `ClampZoom`.

 (3) `newZoom = Some(intrinsicScale);`
...and `intrinsicScale` will be indirectly checked via my new `ClampZoom` assertion.

 (4)  `newZoom = Some(clampedZoom);`
...where `clampedZoom` is the result of a `ClampZoom()` call and hence will be checked via my new assertion.
I'm planning on adding an assertion to `ClampZoom()` here.

That should give us coverage, because here are all the places where we give `newZoom` a value:
 (1)      `newZoom = Some(defaultZoom);`
... and here, the `defaultZoom`  value comes from either:
 - a ClampZoom(...) call (where I'm adding an assertion)
 - or from an `aViewportInfo.GetDefaultZoom()` call (which is already checked via an assertion from Bug 1566991)
 - or from `intrinsicScale` whose value comes from `ComputeIntrinsicScale(...)` which calls `ClampZoom(...)` before returning (and I'm adding an assertion to `ClampZoom()` as noted above.

 (2) `newZoom = Some(ClampZoom(adjustedZoom, aViewportInfo));`
... and here, this will be trivially checked via the assertion I'm adding in `ClampZoom`.

 (3) `newZoom = Some(intrinsicScale);`
...and `intrinsicScale` will be indirectly checked via my new `ClampZoom` assertion as discussed in a bullet point under (1) above.

 (4)  `newZoom = Some(clampedZoom);`
...where `clampedZoom` is the result of a `ClampZoom()` call and hence will be checked via my new assertion.
I'm planning on adding an assertion to `ClampZoom()` here.

That should give us coverage, because here are all the places where we give `newZoom` a value:
 (1)      `newZoom = Some(defaultZoom);`
... and here, the `defaultZoom`  value comes from either:
 - a `ClampZoom(...)` call (and I'm adding an assertion inside that function)
 - or from an `aViewportInfo.GetDefaultZoom()` call (which is already checked via an assertion from Bug 1566991)
 - or from `intrinsicScale` whose value comes from `ComputeIntrinsicScale(...)` which calls `ClampZoom(...)` before returning (and I'm adding an assertion to `ClampZoom()` as noted above.

 (2) `newZoom = Some(ClampZoom(adjustedZoom, aViewportInfo));`
... and here, this will be trivially checked via the assertion I'm adding in `ClampZoom`.

 (3) `newZoom = Some(intrinsicScale);`
...and `intrinsicScale` will be indirectly checked via my new `ClampZoom` assertion as discussed in a bullet point under (1) above.

 (4)  `newZoom = Some(clampedZoom);`
...where `clampedZoom` is the result of a `ClampZoom()` call and hence will be checked via my new assertion.

Back to Bug 1568673 Comment 1