summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_zoom_after_gpu_process_restart.html
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_zoom_after_gpu_process_restart.html')
-rw-r--r--gfx/layers/apz/test/mochitest/helper_zoom_after_gpu_process_restart.html63
1 files changed, 63 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_zoom_after_gpu_process_restart.html b/gfx/layers/apz/test/mochitest/helper_zoom_after_gpu_process_restart.html
new file mode 100644
index 0000000000..292d8f4600
--- /dev/null
+++ b/gfx/layers/apz/test/mochitest/helper_zoom_after_gpu_process_restart.html
@@ -0,0 +1,63 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width">
+ <title>Sanity check for pinch zooming after GPU process restart</title>
+ <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
+ <script type="application/javascript" src="apz_test_utils.js"></script>
+ <script src="/tests/SimpleTest/paint_listener.js"></script>
+ <script type="application/javascript">
+
+async function test() {
+ let initial_resolution = await getResolution();
+ ok(initial_resolution > 0,
+ "The initial_resolution is " + initial_resolution + ", which is some sane value");
+
+ // Kill the GPU process
+ await SpecialPowers.spawnChrome([], async () => {
+ const gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
+
+ if (gfxInfo.usingGPUProcess) {
+ const { TestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/TestUtils.sys.mjs"
+ );
+ let promise = TestUtils.topicObserved("compositor-reinitialized");
+
+ gfxInfo.killGPUProcessForTests();
+ await promise;
+ }
+ });
+
+ // Ensure resolution is unchanged by GPU process restart
+ await waitUntilApzStable();
+ let resolution = await getResolution();
+ ok(
+ resolution == initial_resolution,
+ "The resolution (" + resolution + ") is the same after GPU process restart"
+ );
+
+ // Perform the zoom
+ await pinchZoomInWithTouch(150, 300);
+
+ // Flush state and get the resolution we're at now
+ await promiseApzFlushedRepaints();
+ let final_resolution = await getResolution();
+ ok(
+ final_resolution > initial_resolution,
+ "The final resolution (" + final_resolution + ") is greater after zooming in"
+ );
+}
+
+waitUntilApzStable()
+ .then(test)
+ .then(subtestDone, subtestFailed);
+
+ </script>
+</head>
+<body>
+ Here is some text to stare at as the test runs. It serves no functional
+ purpose, but gives you an idea of the zoom level. It's harder to tell what
+ the zoom level is when the page is just solid white.
+</body>
+</html>