Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / canvas / 2d.backingStorePixelRatio.html
1 <pre id="console"></pre>
2 <script>
3     function log(message)
4     {
5         document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
6     }
7
8     if (window.testRunner) {
9         testRunner.dumpAsText();
10         var canvas1 = document.createElement("canvas");
11         var context1 = canvas1.getContext("2d");
12
13         testRunner.waitUntilDone();
14         testRunner.setBackingScaleFactor(2, function() {
15             var canvas2 = document.createElement("canvas");
16             var context2 = canvas2.getContext("2d");
17
18             log ("context1.webkitBackingStorePixelRatio is " + context1.webkitBackingStorePixelRatio);
19             log ("context2.webkitBackingStorePixelRatio is " + context2.webkitBackingStorePixelRatio);
20
21             testRunner.notifyDone();
22         });
23     } else {
24         log ("When not run inside DumpRenderTree or WebKitTestRunner, this test just prints the value of");
25         log ("backingStorePixelRatio. Please verify that it matches what you expect, based on the");
26         log ("current configuration.\n");
27         var canvas = document.createElement("canvas");
28         var context = canvas.getContext("2d");
29         log ("context.webkitBackingStorePixelRatio is " + context.webkitBackingStorePixelRatio);
30     }
31 </script>