Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / scrolling / resources / scrollable-area.js
blob43319c51044bbbaefbf7c93c913e7e1cb49a7e5a
1 var referenceResult = 0;
2 var referenceResult2 = 0;
3 var referenceIntermediateFunction = 0;
4 var isDRT = window.testRunner && window.internals && window.internals.numberOfScrollableAreas;
6 function runTest(firstResult, intermediateFunction, secondResult)
8 if (isDRT) {
9 testRunner.waitUntilDone();
10 testRunner.dumpAsText();
13 referenceResult = firstResult;
14 if (intermediateFunction) {
15 referenceIntermediateFunction = intermediateFunction;
16 referenceResult2 = secondResult;
18 setTimeout(end, 0);
21 function end()
23 var result = 0;
25 if (isDRT) {
26 result = internals.numberOfScrollableAreas(document);
27 shouldBeTrue(stringify(result == referenceResult));
28 if (referenceIntermediateFunction) {
29 referenceIntermediateFunction();
30 result = internals.numberOfScrollableAreas(document);
31 shouldBeTrue(stringify(result == referenceResult2));
34 testRunner.notifyDone();
35 return;
38 if (referenceIntermediateFunction)
39 referenceIntermediateFunction();