Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / change-compositing-settings.html
blob48c0a63dbb2d411f841ff40056478a0b9022bf74
1 <!DOCTYPE HTML>
2 <script src="../resources/js-test.js"></script>
3 <style>
4 #scroller {
5 overflow: scroll;
6 height: 300px;
7 width: 300px;
8 background-color: red;
11 #scrolled {
12 height: 1000px;
13 width: 250px;
14 background-color: green;
16 </style>
18 <script>
19 jsTestIsAsync = true;
21 description('This test checks that changes to the compositor\'s settings are applied correctly.');
23 function isUsingCompositedScrolling(layer) {
24 layer = layer || JSON.parse(window.internals.layerTreeAsText(document));
25 if (layer.bounds[1] == 1000)
26 return true;
27 if (layer.children) {
28 for (var i = 0; i < layer.children.length; i++) {
29 if (isUsingCompositedScrolling(layer.children[i]))
30 return true;
33 return false;
36 window.onload = function() {
37 if (!window.internals) {
38 testFailed('This test requires window.internals');
39 return;
41 window.internals.settings.setPreferCompositingToLCDTextEnabled(false);
42 var stateBefore = isUsingCompositedScrolling();
43 window.internals.settings.setPreferCompositingToLCDTextEnabled(true);
44 var stateAfter = isUsingCompositedScrolling();
46 if (!stateBefore && stateAfter) {
47 testPassed('Composited scrolling became enabled.');
48 } else {
49 testFailed('Composited scrolling did not become enabled: ' + stateBefore + ", " + stateAfter);
51 finishJSTest();
53 </script>
55 <div id="scroller">
56 <div id="scrolled"></div>
57 </div>