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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/js-test.js"></script>
3 <script>
4 window.jsTestIsAsync = true;
5
6 var FixedRasterScaleBlurryContent = 1343; // From UseCounter.h
7 var FixedRasterScalePotentialPerformanceRegression = 1344; // From UseCounter.h
8
9 function verify(step) {
10 testRunner.dumpAsText();
11 switch (step) {
12 case 0: // initial state
13 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScaleBlurr yContent)");
14 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePoten tialPerformanceRegression)");
15 break;
16 case 1: // first transform set
17 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScaleBlurr yContent)");
18 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePoten tialPerformanceRegression)");
19 break;
20 case 2: // second transform set to 1.0 scale
21 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScaleBlurr yContent)");
22 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePoten tialPerformanceRegression)");
23 break;
24 case 3: // remainder of transforms are set to != 1.0 scale
25 case 4:
26 case 5:
27 case 6:
28 shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScaleBlurry Content)");
29 shouldBeFalse("window.internals.isUseCounted(document, FixedRasterScalePoten tialPerformanceRegression)");
30 break;
31 default:
32 shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScaleBlurry Content)");
33 shouldBeTrue("window.internals.isUseCounted(document, FixedRasterScalePotent ialPerformanceRegression)");
34 break;
35 }
36 }
37
38 function mutate(step) {
39 var div = document.getElementById("div");
40
41 // First scale is 0.5; second scale is 1.0; scale is > 1.0 for the remainder o f steps.
42 var scale = 0.5 * (step + 1);
43 div.style.transform = "translateZ(0) scale(" + scale + ", " + scale + ")";
44 }
45
46 function schedule(step) {
47 if (step <= 8) {
48 if (window.testRunner) {
49 window.testRunner.capturePixelsAsyncThen(function() {
50 verify(step);
51 mutate(step);
52 schedule(step+1);
53 });
54 }
55 } else {
56 finishJSTest();
57 }
58 }
59
60 requestAnimationFrame(function() { schedule(0); });
61 </script>
62 <div id="div" style="transform:translateZ(0); width:100px; height:100px; backgro und-color:blue;">non-solid div</div>
63
64 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698