Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1697)

Unified Diff: third_party/WebKit/LayoutTests/compositing/fixed-raster-scale-use-counts.html

Issue 1946403003: Add fixed raster scale use counter histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+fix Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/compositing/fixed-raster-scale-use-counts.html
diff --git a/third_party/WebKit/LayoutTests/compositing/fixed-raster-scale-use-counts.html b/third_party/WebKit/LayoutTests/compositing/fixed-raster-scale-use-counts.html
new file mode 100644
index 0000000000000000000000000000000000000000..706af40715ff3130a15c87da39c659eea4b8428f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/compositing/fixed-raster-scale-use-counts.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<script src="../resources/js-test.js"></script>
+<script>
+window.jsTestIsAsync = true;
+
+var FixedRasterScaleBlurryContent = 1373; // From UseCounter.h
+var FixedRasterScalePotentialPerformanceRegression = 1374; // From UseCounter.h
+
+function verify(step) {
+ switch (step) {
+ case 0: // initial state
+ shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScaleBlurryContent)");
+ shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePotentialPerformanceRegression)");
+ break;
+ case 1: // first transform set to 1.0 scale
+ shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScaleBlurryContent)");
+ shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePotentialPerformanceRegression)");
+ break;
+ case 2: // remainder of transforms are set to != 1.0 scale
+ case 3:
+ case 4:
+ case 5:
+ shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScaleBlurryContent)");
+ shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePotentialPerformanceRegression)");
+ break;
+ default:
+ shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScaleBlurryContent)");
+ shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScalePotentialPerformanceRegression)");
+ break;
+ }
+}
+
+function mutate(step) {
+ var div = document.getElementById("div");
+
+ // First scale is 1.0; scale is > 1.0 for the remainder of steps.
+ var scale = 2 * (step + 1);
+ div.style.transform = "translateZ(0) scale(" + scale + ", " + scale + ")";
+}
+
+function schedule(step) {
+ if (step <= 8) {
+ if (window.testRunner) {
+ window.testRunner.capturePixelsAsyncThen(function() {
+ verify(step);
+ mutate(step);
+ schedule(step+1);
+ });
+ }
+ } else {
+ finishJSTest();
+ }
+}
+
+requestAnimationFrame(function() { schedule(0); });
+</script>
+<div id="div" style="transform:translateZ(0); width:100px; height:100px; background-color:blue;">non-solid div</div>
+
+</html>

Powered by Google App Engine
This is Rietveld 408576698