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

Side by Side Diff: LayoutTests/css3/device-adapt/viewport-user-style.html

Issue 1058723002: Remove testRunner.injectStyleSheet usage from layout tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>User stylesheet containing an @viewport rule</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <style>
8 html, body { width: 100%; height: 100%; margin: 0 }
9
10 @viewport {
11 height: 2000px;
12 }
13 </style>
14 <script>
15 test(function(){
16 assert_own_property(window, "testRunner");
17 }, "Check that window.testRunner is present. Required to add a user styl esheet.");
18
19 if (window.testRunner) {
20 testRunner.injectStyleSheet("@viewport { width: 450px; height: auto; zoom: auto; min-zoom: auto; max-zoom: auto }", true);
21 }
22 </script>
23 </head>
24 <body>
25 <div id="log"></div>
26 <script>
27 test(function(){
28 assert_own_property(window, "internals");
29 }, "Check that window.internals is present. Required to call viewportAsT ext.");
30
31 var actualWidth;
32 var actualHeight;
33
34 document.body.offsetHeight;
35
36 var vpString = internals.viewportAsText(document, 1, 320, 352);
37 var match = /viewport size (.+)x(.+) scale (.+ )/.exec(vpString);
38
39 if (match) {
40 actualWidth = parseFloat(match[1]);
41 actualHeight = parseFloat(match[2]);
42 }
43
44 test(function(){
45 assert_equals(actualWidth, 450);
46 }, "Check that we get the viewport width from the user stylesheet.");
47
48 test(function(){
49 assert_equals(actualHeight, 2000);
50 }, "Check that we get the viewport height from the author stylesheet.");
51 </script>
52 </body>
53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698