-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathviewport-scale-with-pinch-zoom-in.html
More file actions
38 lines (32 loc) · 1.43 KB
/
viewport-scale-with-pinch-zoom-in.html
File metadata and controls
38 lines (32 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Viewport Scale : Pinch Zoom In</title>
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/9004">
<link rel=help href="https://www.w3.org/TR/2015/WD-mobile-accessibility-mapping-20150226/#zoom-magnification">
<link rel="author" title="Shubham Gupta" href="mailto:shubham.gupta@chromium.org">
<meta name="assert" content="The page can be pinch zoomed-in.">
<meta name="viewport" content="minimum-scale=0.1, initial-scale=1.0, maximum-scale=10.0">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/visual-viewport/viewport_support.js"></script>
</head>
<body>
<div style="font-size: 50px;">Pinch Zoom Test: Zoom In</div>
<script>
promise_test(async () => {
const initialScale = window.visualViewport.scale;
await pinchZoomIn();
assert_greater_than(window.visualViewport.scale, initialScale,
"Scale should be greater than initial scale after pinch zoom in");
const afterZoomIn = window.visualViewport.scale;
await pinchZoomOut();
assert_less_than(window.visualViewport.scale, afterZoomIn,
"Scale should be less than after pinch zoom out");
}) </script>
</body>
</html>