Changeset 127577 in webkit
- Timestamp:
- Sep 5, 2012 4:36:03 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r127520 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 Added symbols for GTK builds for corresponding APIs. 10 11 * Source/autotools/symbols.filter: 12 1 13 2012-09-04 Julien Chaffraix <jchaffraix@webkit.org> 2 14 -
trunk/LayoutTests/ChangeLog
r127575 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 Fixed test cases to use internals API instead of testRunner. 10 11 * printing/numberOfPages-expected.txt: 12 * printing/page-count-layout-overflow.html: 13 * printing/page-count-relayout-shrink.html: 14 * printing/page-count-with-one-word.html: 15 * printing/page-format-data-display-none.html: 16 * printing/page-format-data-expected.txt: 17 * printing/page-format-data.html: 18 * printing/page-rule-selection-expected.txt: 19 * printing/page-rule-selection.html: 20 * printing/resources/paged-media-test-utils.js: 21 (numberOfPagesShouldBe): 22 * printing/script-tests/numberOfPages.js: 23 * printing/zoomed-document.html: 24 1 25 2012-09-05 Dominik Röttsches <dominik.rottsches@intel.com> 2 26 -
trunk/LayoutTests/printing/numberOfPages-expected.txt
r120417 r127577 1 Test for testRunner.numberOfPages()1 Test for internals.numberOfPages() 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -
trunk/LayoutTests/printing/page-count-layout-overflow.html
r120417 r127577 22 22 lines = lines.concat(lines); 23 23 document.body.innerHTML = '<p>' + lines.join('') + '</p>'; 24 document.body.textContent = 'When printing, layout overflow must be cleared after current document size is queried: ' + ( testRunner.numberOfPages() > 1 ? 'PASS' : 'FAIL');24 document.body.textContent = 'When printing, layout overflow must be cleared after current document size is queried: ' + (internals.numberOfPages() > 1 ? 'PASS' : 'FAIL'); 25 25 } 26 26 -
trunk/LayoutTests/printing/page-count-relayout-shrink.html
r120417 r127577 18 18 19 19 testRunner.dumpAsText(); 20 var pages = testRunner.numberOfPages();20 var pages = internals.numberOfPages(); 21 21 document.body.textContent = 'Document has ' + pages + ' pages.'; 22 22 } -
trunk/LayoutTests/printing/page-count-with-one-word.html
r120417 r127577 14 14 for (var i = 530; i < 560; i++) { 15 15 for (var j = 730; j < 760; j++) { 16 var numberOfPages = testRunner.numberOfPages(i, j);16 var numberOfPages = internals.numberOfPages(i, j); 17 17 18 18 if (numberOfPages != 1) { -
trunk/LayoutTests/printing/page-format-data-display-none.html
r120417 r127577 23 23 24 24 // The test passes if the following line doesn't cause a crash. 25 testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4);25 internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4); 26 26 27 27 document.getElementById("output").innerHTML = "PASS"; -
trunk/LayoutTests/printing/page-format-data-expected.txt
r120417 r127577 16 16 17 17 Test default page size 18 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4)18 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4) 19 19 Test auto page size 20 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4)20 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4) 21 21 Test landscape 22 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(200, 100)' + pxMargins(1, 2, 3, 4)23 PASS testRunner.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4) is '(200, 100)' + pxMargins(1, 2, 3, 4)22 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(200, 100)' + pxMargins(1, 2, 3, 4) 23 PASS internals.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4) is '(200, 100)' + pxMargins(1, 2, 3, 4) 24 24 Test portrait 25 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4)26 PASS testRunner.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4)25 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4) 26 PASS internals.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4) is '(100, 200)' + pxMargins(1, 2, 3, 4) 27 27 Test a5 28 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(148, 210) + pxMargins(1, 2, 3, 4)28 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(148, 210) + pxMargins(1, 2, 3, 4) 29 29 Test a5 landscape 30 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(210, 148) + pxMargins(1, 2, 3, 4)30 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(210, 148) + pxMargins(1, 2, 3, 4) 31 31 Test portrait a4 32 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(210, 297) + pxMargins(1, 2, 3, 4)32 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(210, 297) + pxMargins(1, 2, 3, 4) 33 33 Test a3 34 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(297, 420) + pxMargins(1, 2, 3, 4)34 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(297, 420) + pxMargins(1, 2, 3, 4) 35 35 Test b5 36 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(176, 250) + pxMargins(1, 2, 3, 4)36 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(176, 250) + pxMargins(1, 2, 3, 4) 37 37 Test b4 38 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(250, 353) + pxMargins(1, 2, 3, 4)38 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(250, 353) + pxMargins(1, 2, 3, 4) 39 39 Test letter 40 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is inchSize(8.5, 11) + pxMargins(1, 2, 3, 4)40 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is inchSize(8.5, 11) + pxMargins(1, 2, 3, 4) 41 41 Test legal 42 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is inchSize(8.5, 14) + pxMargins(1, 2, 3, 4)42 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is inchSize(8.5, 14) + pxMargins(1, 2, 3, 4) 43 43 Test ledger 44 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is inchSize(11, 17) + pxMargins(1, 2, 3, 4)44 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is inchSize(11, 17) + pxMargins(1, 2, 3, 4) 45 45 Test 10cm 46 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(100, 100) + pxMargins(1, 2, 3, 4)46 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(100, 100) + pxMargins(1, 2, 3, 4) 47 47 Test 20cm x 30cm 48 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(200, 300) + pxMargins(1, 2, 3, 4)48 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is mmSize(200, 300) + pxMargins(1, 2, 3, 4) 49 49 Test 10000px 20000px 50 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4)50 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4) 51 51 Test invalid page size: -10cm 52 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4)52 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4) 53 53 Test invalid page size: a4 a4 54 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4)54 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4) 55 55 Test invalid page size: landscape portrait 56 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4)56 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4) 57 57 Test invalid page size: 10cm letter 58 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4)58 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4) 59 59 Test invalid page size: 10cm 10cm 10cm 60 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4)60 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4) 61 61 Test invalid page size: empty 62 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4)62 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 2, 3, 4) 63 63 64 64 Test 0px margins 65 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(0, 0, 0, 0)65 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(0, 0, 0, 0) 66 66 Test non-zero margins 67 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(10, 20, 40, 80)67 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(10, 20, 40, 80) 68 68 Test percentage margin 69 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 200, 100)69 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 200, 100) 70 70 Test margin: auto 4% 2% 1% 71 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 400, 200, 100)71 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(1, 400, 200, 100) 72 72 Test margin: 8% auto 2% 1% 73 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 2, 200, 100)73 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 2, 200, 100) 74 74 Test margin: 8% 4% auto 1% 75 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 3, 100)75 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 3, 100) 76 76 Test margin: 8% 4% 2% auto 77 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 200, 4)77 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 200, 4) 78 78 Test visibility: hidden 79 PASS testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 200, 4)79 PASS internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4) is '(10000, 20000)' + pxMargins(800, 400, 200, 4) 80 80 81 81 PASS successfullyParsed is true -
trunk/LayoutTests/printing/page-format-data.html
r120417 r127577 63 63 64 64 debug("Test default page size"); 65 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)");65 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)"); 66 66 67 67 debug("Test auto page size"); 68 68 appendStyle("@page {size:auto;}"); 69 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)");69 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)"); 70 70 71 71 debug("Test landscape"); 72 72 appendStyle("@page {size:landscape;}"); 73 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(200, 100)' + pxMargins(1, 2, 3, 4)");74 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4)", "'(200, 100)' + pxMargins(1, 2, 3, 4)");73 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(200, 100)' + pxMargins(1, 2, 3, 4)"); 74 shouldBe("internals.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4)", "'(200, 100)' + pxMargins(1, 2, 3, 4)"); 75 75 76 76 debug("Test portrait"); 77 77 appendStyle("@page {size:portrait;}"); 78 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)");79 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)");78 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)"); 79 shouldBe("internals.pageSizeAndMarginsInPixels(0, 200, 100, 1, 2, 3, 4)", "'(100, 200)' + pxMargins(1, 2, 3, 4)"); 80 80 81 81 debug("Test a5"); 82 82 appendStyle("@page {size:a5;}"); 83 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(148, 210) + pxMargins(1, 2, 3, 4)");83 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(148, 210) + pxMargins(1, 2, 3, 4)"); 84 84 85 85 debug("Test a5 landscape"); 86 86 appendStyle("@page {size:a5 landscape;}"); 87 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(210, 148) + pxMargins(1, 2, 3, 4)");87 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(210, 148) + pxMargins(1, 2, 3, 4)"); 88 88 89 89 debug("Test portrait a4"); 90 90 appendStyle("@page {size:portrait a4;}"); 91 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(210, 297) + pxMargins(1, 2, 3, 4)");91 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(210, 297) + pxMargins(1, 2, 3, 4)"); 92 92 93 93 debug("Test a3"); 94 94 appendStyle("@page {size:a3;}"); 95 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(297, 420) + pxMargins(1, 2, 3, 4)");95 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(297, 420) + pxMargins(1, 2, 3, 4)"); 96 96 97 97 debug("Test b5"); 98 98 appendStyle("@page {size:b5;}"); 99 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(176, 250) + pxMargins(1, 2, 3, 4)");99 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(176, 250) + pxMargins(1, 2, 3, 4)"); 100 100 101 101 debug("Test b4"); 102 102 appendStyle("@page {size:b4;}"); 103 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(250, 353) + pxMargins(1, 2, 3, 4)");103 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(250, 353) + pxMargins(1, 2, 3, 4)"); 104 104 105 105 debug("Test letter"); 106 106 appendStyle("@page {size:letter;}"); 107 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "inchSize(8.5, 11) + pxMargins(1, 2, 3, 4)");107 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "inchSize(8.5, 11) + pxMargins(1, 2, 3, 4)"); 108 108 109 109 debug("Test legal"); 110 110 appendStyle("@page {size:legal;}"); 111 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "inchSize(8.5, 14) + pxMargins(1, 2, 3, 4)");111 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "inchSize(8.5, 14) + pxMargins(1, 2, 3, 4)"); 112 112 113 113 debug("Test ledger"); 114 114 appendStyle("@page {size:ledger;}"); 115 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "inchSize(11, 17) + pxMargins(1, 2, 3, 4)");115 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "inchSize(11, 17) + pxMargins(1, 2, 3, 4)"); 116 116 117 117 debug("Test 10cm"); 118 118 appendStyle("@page {size:10cm;}"); 119 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(100, 100) + pxMargins(1, 2, 3, 4)");119 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(100, 100) + pxMargins(1, 2, 3, 4)"); 120 120 121 121 debug("Test 20cm x 30cm"); 122 122 appendStyle("@page {size:20cm 30cm;}"); 123 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(200, 300) + pxMargins(1, 2, 3, 4)");123 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "mmSize(200, 300) + pxMargins(1, 2, 3, 4)"); 124 124 125 125 debug("Test 10000px 20000px"); 126 126 appendStyle("@page {size:10000px 20000px;}"); 127 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)");127 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)"); 128 128 129 129 debug("Test invalid page size: -10cm"); 130 130 appendStyle("@page {size:-10cm;}"); 131 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)");131 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)"); 132 132 133 133 debug("Test invalid page size: a4 a4"); 134 134 appendStyle("@page {size:a4 a4;}"); 135 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)");135 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)"); 136 136 137 137 debug("Test invalid page size: landscape portrait"); 138 138 appendStyle("@page {size:landscape portrait;}"); 139 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)");139 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)"); 140 140 141 141 debug("Test invalid page size: 10cm letter"); 142 142 appendStyle("@page {size:10cm letter;}"); 143 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)");143 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)"); 144 144 145 145 debug("Test invalid page size: 10cm 10cm 10cm"); 146 146 appendStyle("@page {size:10cm 10cm 10cm;}"); 147 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)");147 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)"); 148 148 149 149 debug("Test invalid page size: empty"); 150 150 appendStyle("@page {size:;}"); 151 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)");151 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 2, 3, 4)"); 152 152 153 153 debug(""); … … 157 157 debug("Test 0px margins"); 158 158 appendStyle("@page {margin:0px;}"); 159 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(0, 0, 0, 0)");159 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(0, 0, 0, 0)"); 160 160 161 161 debug("Test non-zero margins"); 162 162 appendStyle("@page {margin:10px 20px 40px 80px;}"); 163 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(10, 20, 40, 80)");163 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(10, 20, 40, 80)"); 164 164 165 165 debug("Test percentage margin"); 166 166 appendStyle("@page {margin: 8% 4% 2% 1%;}"); 167 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 200, 100)");167 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 200, 100)"); 168 168 169 169 debug("Test margin: auto 4% 2% 1%"); 170 170 appendStyle("@page {margin: auto 4% 2% 1%;}"); 171 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 400, 200, 100)");171 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(1, 400, 200, 100)"); 172 172 173 173 debug("Test margin: 8% auto 2% 1%"); 174 174 appendStyle("@page {margin: 8% auto 2% 1%;}"); 175 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 2, 200, 100)");175 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 2, 200, 100)"); 176 176 177 177 debug("Test margin: 8% 4% auto 1%"); 178 178 appendStyle("@page {margin: 8% 4% auto 1%;}"); 179 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 3, 100)");179 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 3, 100)"); 180 180 181 181 debug("Test margin: 8% 4% 2% auto"); 182 182 appendStyle("@page {margin: 8% 4% 2% auto;}"); 183 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 200, 4)");183 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 200, 4)"); 184 184 185 185 debug("Test visibility: hidden"); 186 186 appendStyle("@page {visibility:hidden}"); 187 shouldBe(" testRunner.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 200, 4)");187 shouldBe("internals.pageSizeAndMarginsInPixels(0, 100, 200, 1, 2, 3, 4)", "'(10000, 20000)' + pxMargins(800, 400, 200, 4)"); 188 188 189 189 debug(""); -
trunk/LayoutTests/printing/page-rule-selection-expected.txt
r120417 r127577 5 5 6 6 Default margin is auto. 7 PASS testRunner.pageProperty('margin-left', 0) is "auto"8 PASS testRunner.pageProperty('margin-left', 1) is "auto"9 PASS testRunner.pageProperty('margin-left', 2) is "auto"10 PASS testRunner.pageProperty('margin-left', 3) is "auto"11 PASS testRunner.pageProperty('margin-left', 4) is "auto"7 PASS internals.pageProperty('margin-left', 0) is "auto" 8 PASS internals.pageProperty('margin-left', 1) is "auto" 9 PASS internals.pageProperty('margin-left', 2) is "auto" 10 PASS internals.pageProperty('margin-left', 3) is "auto" 11 PASS internals.pageProperty('margin-left', 4) is "auto" 12 12 Set margin to 200px via user style sheet. 13 PASS testRunner.pageProperty('margin-left', 0) is "200"14 PASS testRunner.pageProperty('margin-left', 1) is "200"15 PASS testRunner.pageProperty('margin-left', 2) is "200"16 PASS testRunner.pageProperty('margin-left', 3) is "200"17 PASS testRunner.pageProperty('margin-left', 4) is "200"13 PASS internals.pageProperty('margin-left', 0) is "200" 14 PASS internals.pageProperty('margin-left', 1) is "200" 15 PASS internals.pageProperty('margin-left', 2) is "200" 16 PASS internals.pageProperty('margin-left', 3) is "200" 17 PASS internals.pageProperty('margin-left', 4) is "200" 18 18 Set margin to 100px. 19 PASS testRunner.pageProperty('margin-left', 0) is "100"20 PASS testRunner.pageProperty('margin-left', 1) is "100"21 PASS testRunner.pageProperty('margin-left', 2) is "100"22 PASS testRunner.pageProperty('margin-left', 3) is "100"23 PASS testRunner.pageProperty('margin-left', 4) is "100"19 PASS internals.pageProperty('margin-left', 0) is "100" 20 PASS internals.pageProperty('margin-left', 1) is "100" 21 PASS internals.pageProperty('margin-left', 2) is "100" 22 PASS internals.pageProperty('margin-left', 3) is "100" 23 PASS internals.pageProperty('margin-left', 4) is "100" 24 24 Set margin for right pages to 50px. The first page is a right page. 25 PASS testRunner.pageProperty('margin-left', 0) is "50"26 PASS testRunner.pageProperty('margin-left', 1) is "100"27 PASS testRunner.pageProperty('margin-left', 2) is "50"28 PASS testRunner.pageProperty('margin-left', 3) is "100"29 PASS testRunner.pageProperty('margin-left', 4) is "50"25 PASS internals.pageProperty('margin-left', 0) is "50" 26 PASS internals.pageProperty('margin-left', 1) is "100" 27 PASS internals.pageProperty('margin-left', 2) is "50" 28 PASS internals.pageProperty('margin-left', 3) is "100" 29 PASS internals.pageProperty('margin-left', 4) is "50" 30 30 Set margin for left pages to 75px. 31 PASS testRunner.pageProperty('margin-left', 0) is "50"32 PASS testRunner.pageProperty('margin-left', 1) is "75"33 PASS testRunner.pageProperty('margin-left', 2) is "50"34 PASS testRunner.pageProperty('margin-left', 3) is "75"35 PASS testRunner.pageProperty('margin-left', 4) is "50"31 PASS internals.pageProperty('margin-left', 0) is "50" 32 PASS internals.pageProperty('margin-left', 1) is "75" 33 PASS internals.pageProperty('margin-left', 2) is "50" 34 PASS internals.pageProperty('margin-left', 3) is "75" 35 PASS internals.pageProperty('margin-left', 4) is "50" 36 36 Set margin for the first page to 125px. 37 PASS testRunner.pageProperty('margin-left', 0) is "125"38 PASS testRunner.pageProperty('margin-left', 1) is "75"39 PASS testRunner.pageProperty('margin-left', 2) is "50"40 PASS testRunner.pageProperty('margin-left', 3) is "75"41 PASS testRunner.pageProperty('margin-left', 4) is "50"37 PASS internals.pageProperty('margin-left', 0) is "125" 38 PASS internals.pageProperty('margin-left', 1) is "75" 39 PASS internals.pageProperty('margin-left', 2) is "50" 40 PASS internals.pageProperty('margin-left', 3) is "75" 41 PASS internals.pageProperty('margin-left', 4) is "50" 42 42 Change the document direction to RTL. This makes the first page a left page. 43 PASS testRunner.pageProperty('margin-left', 0) is "125"44 PASS testRunner.pageProperty('margin-left', 1) is "50"45 PASS testRunner.pageProperty('margin-left', 2) is "75"46 PASS testRunner.pageProperty('margin-left', 3) is "50"47 PASS testRunner.pageProperty('margin-left', 4) is "75"43 PASS internals.pageProperty('margin-left', 0) is "125" 44 PASS internals.pageProperty('margin-left', 1) is "50" 45 PASS internals.pageProperty('margin-left', 2) is "75" 46 PASS internals.pageProperty('margin-left', 3) is "50" 47 PASS internals.pageProperty('margin-left', 4) is "75" 48 48 Check font update and line height override. 49 PASS testRunner.pageProperty('line-height', 0) is "180"50 PASS testRunner.pageProperty('font-family', 0) is "Arial"51 PASS testRunner.pageProperty('font-size', 0) is "30"49 PASS internals.pageProperty('line-height', 0) is "180" 50 PASS internals.pageProperty('font-family', 0) is "Arial" 51 PASS internals.pageProperty('font-size', 0) is "30" 52 52 Check @media rules. 53 PASS testRunner.pageProperty('size', 0) is "100 200"54 PASS testRunner.pageProperty('size', 0) is "150 250"55 PASS testRunner.pageProperty('size', 0) is "150 250"53 PASS internals.pageProperty('size', 0) is "100 200" 54 PASS internals.pageProperty('size', 0) is "150 250" 55 PASS internals.pageProperty('size', 0) is "150 250" 56 56 PASS successfullyParsed is true 57 57 -
trunk/LayoutTests/printing/page-rule-selection.html
r120417 r127577 21 21 22 22 debug("Default margin is auto."); 23 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 0)", "auto");24 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 1)", "auto");25 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 2)", "auto");26 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 3)", "auto");27 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 4)", "auto");23 shouldBeEqualToString("internals.pageProperty('margin-left', 0)", "auto"); 24 shouldBeEqualToString("internals.pageProperty('margin-left', 1)", "auto"); 25 shouldBeEqualToString("internals.pageProperty('margin-left', 2)", "auto"); 26 shouldBeEqualToString("internals.pageProperty('margin-left', 3)", "auto"); 27 shouldBeEqualToString("internals.pageProperty('margin-left', 4)", "auto"); 28 28 29 29 debug("Set margin to 200px via user style sheet."); 30 30 testRunner.addUserStyleSheet("@page { margin:200px; }", true); 31 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 0)", "200");32 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 1)", "200");33 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 2)", "200");34 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 3)", "200");35 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 4)", "200");31 shouldBeEqualToString("internals.pageProperty('margin-left', 0)", "200"); 32 shouldBeEqualToString("internals.pageProperty('margin-left', 1)", "200"); 33 shouldBeEqualToString("internals.pageProperty('margin-left', 2)", "200"); 34 shouldBeEqualToString("internals.pageProperty('margin-left', 3)", "200"); 35 shouldBeEqualToString("internals.pageProperty('margin-left', 4)", "200"); 36 36 37 37 debug("Set margin to 100px."); 38 38 appendStyle("@page { margin:100px; }"); 39 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 0)", "100");40 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 1)", "100");41 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 2)", "100");42 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 3)", "100");43 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 4)", "100");39 shouldBeEqualToString("internals.pageProperty('margin-left', 0)", "100"); 40 shouldBeEqualToString("internals.pageProperty('margin-left', 1)", "100"); 41 shouldBeEqualToString("internals.pageProperty('margin-left', 2)", "100"); 42 shouldBeEqualToString("internals.pageProperty('margin-left', 3)", "100"); 43 shouldBeEqualToString("internals.pageProperty('margin-left', 4)", "100"); 44 44 45 45 debug("Set margin for right pages to 50px. The first page is a right page."); 46 46 appendStyle("@page :right { margin:50px; }"); 47 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 0)", "50");48 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 1)", "100");49 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 2)", "50");50 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 3)", "100");51 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 4)", "50");47 shouldBeEqualToString("internals.pageProperty('margin-left', 0)", "50"); 48 shouldBeEqualToString("internals.pageProperty('margin-left', 1)", "100"); 49 shouldBeEqualToString("internals.pageProperty('margin-left', 2)", "50"); 50 shouldBeEqualToString("internals.pageProperty('margin-left', 3)", "100"); 51 shouldBeEqualToString("internals.pageProperty('margin-left', 4)", "50"); 52 52 53 53 debug("Set margin for left pages to 75px."); 54 54 appendStyle("@page :left { margin:75px; }"); 55 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 0)", "50");56 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 1)", "75");57 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 2)", "50");58 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 3)", "75");59 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 4)", "50");55 shouldBeEqualToString("internals.pageProperty('margin-left', 0)", "50"); 56 shouldBeEqualToString("internals.pageProperty('margin-left', 1)", "75"); 57 shouldBeEqualToString("internals.pageProperty('margin-left', 2)", "50"); 58 shouldBeEqualToString("internals.pageProperty('margin-left', 3)", "75"); 59 shouldBeEqualToString("internals.pageProperty('margin-left', 4)", "50"); 60 60 61 61 debug("Set margin for the first page to 125px."); 62 62 appendStyle("@page :first { margin:125px; }"); 63 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 0)", "125");64 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 1)", "75");65 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 2)", "50");66 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 3)", "75");67 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 4)", "50");63 shouldBeEqualToString("internals.pageProperty('margin-left', 0)", "125"); 64 shouldBeEqualToString("internals.pageProperty('margin-left', 1)", "75"); 65 shouldBeEqualToString("internals.pageProperty('margin-left', 2)", "50"); 66 shouldBeEqualToString("internals.pageProperty('margin-left', 3)", "75"); 67 shouldBeEqualToString("internals.pageProperty('margin-left', 4)", "50"); 68 68 69 69 debug("Change the document direction to RTL. This makes the first page a left page."); 70 70 document.getElementById("html_element").setAttribute("dir", "rtl"); 71 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 0)", "125");72 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 1)", "50");73 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 2)", "75");74 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 3)", "50");75 shouldBeEqualToString(" testRunner.pageProperty('margin-left', 4)", "75");71 shouldBeEqualToString("internals.pageProperty('margin-left', 0)", "125"); 72 shouldBeEqualToString("internals.pageProperty('margin-left', 1)", "50"); 73 shouldBeEqualToString("internals.pageProperty('margin-left', 2)", "75"); 74 shouldBeEqualToString("internals.pageProperty('margin-left', 3)", "50"); 75 shouldBeEqualToString("internals.pageProperty('margin-left', 4)", "75"); 76 76 77 77 debug("Check font update and line height override."); … … 80 80 appendStyle("@page { font:15px/6em Arial; }"); 81 81 appendStyle("@page { zoom:200%; }"); 82 shouldBeEqualToString(" testRunner.pageProperty('line-height', 0)", "180");83 shouldBeEqualToString(" testRunner.pageProperty('font-family', 0)", "Arial");84 shouldBeEqualToString(" testRunner.pageProperty('font-size', 0)", "30");82 shouldBeEqualToString("internals.pageProperty('line-height', 0)", "180"); 83 shouldBeEqualToString("internals.pageProperty('font-family', 0)", "Arial"); 84 shouldBeEqualToString("internals.pageProperty('font-size', 0)", "30"); 85 85 appendStyle("@page { zoom:100%; }"); 86 86 87 87 debug("Check @media rules."); 88 88 appendStyle("@page { size:100px 200px; }"); 89 shouldBeEqualToString(" testRunner.pageProperty('size', 0)", "100 200");89 shouldBeEqualToString("internals.pageProperty('size', 0)", "100 200"); 90 90 appendStyle("@media print { @page { size:150px 250px; } }"); 91 shouldBeEqualToString(" testRunner.pageProperty('size', 0)", "150 250");91 shouldBeEqualToString("internals.pageProperty('size', 0)", "150 250"); 92 92 appendStyle("@media screen { @page { size:300px 500px; } }"); 93 shouldBeEqualToString(" testRunner.pageProperty('size', 0)", "150 250");93 shouldBeEqualToString("internals.pageProperty('size', 0)", "150 250"); 94 94 95 95 } else { -
trunk/LayoutTests/printing/resources/paged-media-test-utils.js
r123711 r127577 27 27 var actualNumberOfPages; 28 28 if (pageWidthInPixels && pageHeightInPixels) 29 actualNumberOfPages = testRunner.numberOfPages(pageWidthInPixels, pageHeightInPixels);29 actualNumberOfPages = internals.numberOfPages(pageWidthInPixels, pageHeightInPixels); 30 30 else 31 actualNumberOfPages = testRunner.numberOfPages();31 actualNumberOfPages = internals.numberOfPages(); 32 32 33 33 if (actualNumberOfPages == expectedNumberOfPages) -
trunk/LayoutTests/printing/script-tests/numberOfPages.js
r120417 r127577 1 description("Test for testRunner.numberOfPages()");1 description("Test for internals.numberOfPages()"); 2 2 3 3 function test() -
trunk/LayoutTests/printing/zoomed-document.html
r120417 r127577 14 14 var height; 15 15 for (var i = 10; i < 100; i += 5) { 16 if ( testRunner.numberOfPages(100, i) == 1) {16 if (internals.numberOfPages(100, i) == 1) { 17 17 height = i; 18 18 break; … … 22 22 // Zoom in and verify that page count does not change. 23 23 for (var i = 0; i < 10; i++) { 24 var numberOfPages = testRunner.numberOfPages(100, height);24 var numberOfPages = internals.numberOfPages(100, height); 25 25 if (numberOfPages != 1) { 26 26 pass = false; -
trunk/Source/WebCore/ChangeLog
r127576 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 10 Covered by existing test cases. 11 12 * testing/Internals.cpp: 13 (WebCore::Internals::numberOfPages): 14 (WebCore): 15 (WebCore::Internals::pageProperty): 16 (WebCore::Internals::pageSizeAndMarginsInPixels): 17 * testing/Internals.h: 18 (Internals): 19 * testing/Internals.idl: 20 1 21 2012-09-05 Simon Hausmann <simon.hausmann@nokia.com> 2 22 -
trunk/Source/WebCore/testing/Internals.cpp
r127457 r127577 1171 1171 } 1172 1172 1173 int Internals::numberOfPages(float pageWidth, float pageHeight) 1174 { 1175 if (!frame()) 1176 return -1; 1177 1178 return PrintContext::numberOfPages(frame(), FloatSize(pageWidth, pageHeight)); 1179 } 1180 1181 String Internals::pageProperty(String propertyName, int pageNumber, ExceptionCode& ec) const 1182 { 1183 if (!frame()) { 1184 ec = INVALID_ACCESS_ERR; 1185 return String(); 1186 } 1187 1188 return PrintContext::pageProperty(frame(), propertyName.utf8().data(), pageNumber); 1189 } 1190 1191 String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionCode& ec) const 1192 { 1193 if (!frame()) { 1194 ec = INVALID_ACCESS_ERR; 1195 return String(); 1196 } 1197 1198 return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft); 1199 } 1200 1173 1201 #if ENABLE(FULLSCREEN_API) 1174 1202 void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element) -
trunk/Source/WebCore/testing/Internals.h
r127457 r127577 28 28 29 29 #include "ContextDestructionObserver.h" 30 #include "ExceptionCodePlaceholder.h" 30 31 #include "NodeList.h" 31 32 #include "PlatformString.h" … … 200 201 PassRefPtr<DOMStringList> iconURLs(Document*) const; 201 202 203 int numberOfPages(float pageWidthInPixels = 800, float pageHeightInPixels = 600); 204 String pageProperty(String, int, ExceptionCode& = ASSERT_NO_EXCEPTION) const; 205 String pageSizeAndMarginsInPixels(int, int, int, int, int, int, int, ExceptionCode& = ASSERT_NO_EXCEPTION) const; 206 202 207 #if ENABLE(FULLSCREEN_API) 203 208 void webkitWillEnterFullScreenForElement(Document*, Element*); -
trunk/Source/WebCore/testing/Internals.idl
r127457 r127577 176 176 long pageNumber(in Element element, in [Optional] float pageWidth, in [Optional] float pageHeight); 177 177 DOMString[] iconURLs(in Document document); 178 long numberOfPages(in [Optional] double pageWidthInPixels, in [Optional] double pageHeightInPixels); 179 DOMString pageProperty(in DOMString propertyName, in long pageNumber) raises (DOMException); 180 DOMString pageSizeAndMarginsInPixels(in long pageIndex, in long width, in long height, in long marginTop, in long marginRight, in long marginBottom, in long marginLeft) raises (DOMException); 181 178 182 179 183 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API -
trunk/Source/WebKit/efl/ChangeLog
r127462 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 10 * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: 11 * WebCoreSupport/DumpRenderTreeSupportEfl.h: 12 1 13 2012-09-04 Michał Pakuła vel Rutka <m.pakula@samsung.com> 2 14 -
trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
r127385 r127577 156 156 } 157 157 158 int DumpRenderTreeSupportEfl::numberOfPages(const Evas_Object* ewkFrame, float pageWidth, float pageHeight)159 {160 DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, 0);161 162 return WebCore::PrintContext::numberOfPages(frame, WebCore::FloatSize(pageWidth, pageHeight));163 }164 165 String DumpRenderTreeSupportEfl::pageSizeAndMarginsInPixels(const Evas_Object* ewkFrame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)166 {167 DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, String());168 169 return WebCore::PrintContext::pageSizeAndMarginsInPixels(frame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);170 }171 172 String DumpRenderTreeSupportEfl::pageProperty(const Evas_Object* ewkFrame, const char* propertyName, int pageNumber)173 {174 DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, String());175 176 return WebCore::PrintContext::pageProperty(frame, propertyName, pageNumber);177 }178 179 158 bool DumpRenderTreeSupportEfl::pauseAnimation(Evas_Object* ewkFrame, const char* name, const char* elementId, double time) 180 159 { -
trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
r122952 r127577 58 58 static WebCore::Frame* frameParent(const Evas_Object* ewkFrame); 59 59 static void layoutFrame(Evas_Object* ewkFrame); 60 static int numberOfPages(const Evas_Object* ewkFrame, float pageWidth, float pageHeight);61 static int numberOfPagesForElementId(const Evas_Object* ewkFrame, const char* elementId, float pageWidth, float pageHeight);62 static String pageProperty(const Evas_Object* ewkFrame, const char* propertyName, int pageNumber);63 static String pageSizeAndMarginsInPixels(const Evas_Object* ewkFrame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);64 60 static bool pauseAnimation(Evas_Object* ewkFrame, const char* name, const char* elementId, double time); 65 61 static bool pauseTransition(Evas_Object* ewkFrame, const char* name, const char* elementId, double time); -
trunk/Source/WebKit/gtk/ChangeLog
r127483 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 10 * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: 11 * WebCoreSupport/DumpRenderTreeSupportGtk.h: 12 (DumpRenderTreeSupportGtk): 13 1 14 2012-09-04 Joanmarie Diggs <jdiggs@igalia.com> 2 15 -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
r126846 r127577 191 191 192 192 /** 193 * numberOfPagesForFrame194 * @frame: a #WebKitWebFrame195 * @pageWidth: width of a page196 * @pageHeight: height of a page197 *198 * Return value: The number of pages to be printed.199 */200 int DumpRenderTreeSupportGtk::numberOfPagesForFrame(WebKitWebFrame* frame, float pageWidth, float pageHeight)201 {202 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);203 204 Frame* coreFrame = core(frame);205 if (!coreFrame)206 return -1;207 208 return PrintContext::numberOfPages(coreFrame, FloatSize(pageWidth, pageHeight));209 }210 211 /**212 * pageProperty213 * @frame: a #WebKitWebFrame214 * @propertyName: name of a property215 * @pageNumber: number of a page216 *217 * Return value: The value of the given property name.218 */219 CString DumpRenderTreeSupportGtk::pageProperty(WebKitWebFrame* frame, const char* propertyName, int pageNumber)220 {221 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());222 223 Frame* coreFrame = core(frame);224 if (!coreFrame)225 return CString();226 227 return PrintContext::pageProperty(coreFrame, propertyName, pageNumber).utf8();228 }229 230 /**231 * pageSizeAndMarginsInPixels232 * @frame: a #WebKitWebFrame233 * @pageNumber: number of a page234 * @width: width of a page235 * @height: height of a page236 * @marginTop: top margin of a page237 * @marginRight: right margin of a page238 * @marginBottom: bottom margin of a page239 * @marginLeft: left margin of a page240 *241 * Return value: The value of page size and margin.242 */243 CString DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(WebKitWebFrame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)244 {245 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());246 247 Frame* coreFrame = core(frame);248 if (!coreFrame)249 return CString();250 251 return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).utf8();252 }253 254 /**255 193 * addUserStyleSheet 256 194 * @frame: a #WebKitWebFrame -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
r126846 r127577 60 60 static WTF::CString getInnerText(WebKitWebFrame*); 61 61 static WTF::CString dumpRenderTree(WebKitWebFrame*); 62 static int numberOfPagesForFrame(WebKitWebFrame*, float pageWidth, float pageHeight);63 static WTF::CString pageProperty(WebKitWebFrame*, const char* propertyName, int pageNumber);64 static WTF::CString pageSizeAndMarginsInPixels(WebKitWebFrame*, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);65 62 static void addUserStyleSheet(WebKitWebFrame*, const char* sourceCode, bool allFrames); 66 63 static guint getPendingUnloadEventCount(WebKitWebFrame*); -
trunk/Source/WebKit/qt/ChangeLog
r127450 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 10 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 11 (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld): 12 * WebCoreSupport/DumpRenderTreeSupportQt.h: 13 1 14 2012-09-04 Jon Lee <jonlee@apple.com> 2 15 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r127238 r127577 387 387 } 388 388 389 int DumpRenderTreeSupportQt::numberOfPages(QWebFrame* frame, float width, float height)390 {391 Frame* coreFrame = QWebFramePrivate::core(frame);392 if (!coreFrame)393 return -1;394 395 return PrintContext::numberOfPages(coreFrame, FloatSize(width, height));396 }397 398 389 // Suspend active DOM objects in this frame. 399 390 void DumpRenderTreeSupportQt::suspendActiveDOMObjects(QWebFrame* frame) … … 859 850 } 860 851 861 QString DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels(QWebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)862 {863 WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);864 return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageIndex, width, height,865 marginTop, marginRight, marginBottom, marginLeft);866 }867 868 QString DumpRenderTreeSupportQt::pageProperty(QWebFrame* frame, const QString& propertyName, int pageNumber)869 {870 WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);871 return PrintContext::pageProperty(coreFrame, propertyName.toUtf8().constData(), pageNumber);872 }873 874 852 void DumpRenderTreeSupportQt::addUserStyleSheet(QWebPage* page, const QString& sourceCode) 875 853 { -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
r125738 r127577 128 128 static void overwritePluginDirectories(); 129 129 static int numberOfActiveAnimations(QWebFrame*); 130 static int numberOfPages(QWebFrame* frame, float width, float height);131 130 static bool hasDocumentElement(QWebFrame* frame); 132 131 static bool elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId); … … 180 179 static void setCustomPolicyDelegate(bool enabled, bool permissive); 181 180 182 static QString pageSizeAndMarginsInPixels(QWebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);183 static QString pageProperty(QWebFrame* frame, const QString& propertyName, int pageNumber);184 181 static void addUserStyleSheet(QWebPage* page, const QString& sourceCode); 185 182 static void removeUserStyleSheets(QWebPage*); -
trunk/Source/WebKit/win/ChangeLog
r127191 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 Kept the function defination and declaration to keep binary compatibility for IWebFramePrivate.idl 10 11 * WebFrame.cpp: 12 (WebFrame::numberOfPages): 13 1 14 2012-08-30 Benjamin Poulain <bpoulain@apple.com> 2 15 -
trunk/Source/WebKit/win/WebFrame.cpp
r127191 r127577 895 895 /* [retval][out] */ int* result) 896 896 { 897 if (!result) 898 return E_POINTER; 899 900 Frame* coreFrame = core(this); 901 if (!coreFrame) 902 return E_FAIL; 903 904 *result = PrintContext::numberOfPages(coreFrame, FloatSize(pageWidthInPixels, pageHeightInPixels)); 905 return S_OK; 897 // TODO: Please remove this function if not needed as this is LTC specific function 898 // and has been moved to Internals. 899 notImplemented(); 900 return E_FAIL; 906 901 } 907 902 -
trunk/Source/WebKit2/ChangeLog
r127559 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 Add symbols for Mac Win builds for corresponding newly added APIs. 10 11 * win/WebKit2.def: 12 * win/WebKit2CFLite.def: 13 1 14 2012-09-05 Balazs Kelemen <kbalazs@webkit.org> 2 15 -
trunk/Source/WebKit2/win/WebKit2.def
r127457 r127577 277 277 ?profilerEnabled@InspectorController@WebCore@@QAE_NXZ 278 278 ?setProfilerEnabled@InspectorController@WebCore@@QAEX_N@Z 279 ?jsStringWithCacheSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@U?$PtrHash@PAVStringImpl@WTF@@@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z 279 ?jsStringWithCacheSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@U?$PtrHash@PAVStringImpl@WTF@@@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z 280 280 ?registerURLSchemeAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z 281 281 ?removeURLSchemeRegisteredAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z 282 282 ?iconURLs@Document@WebCore@@QAEABV?$Vector@UIconURL@WebCore@@$0A@@WTF@@XZ 283 ?numberOfPages@PrintContext@WebCore@@SAHPAVFrame@2@ABVFloatSize@2@@Z 284 ?pageProperty@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@PBDH@Z 285 ?pageSizeAndMarginsInPixels@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@HHHHHHH@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r127457 r127577 271 271 ?registerURLSchemeAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z 272 272 ?removeURLSchemeRegisteredAsBypassingContentSecurityPolicy@SchemeRegistry@WebCore@@SAXABVString@WTF@@@Z 273 ?numberOfPages@PrintContext@WebCore@@SAHPAVFrame@2@ABVFloatSize@2@@Z 274 ?pageProperty@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@PBDH@Z 275 ?pageSizeAndMarginsInPixels@PrintContext@WebCore@@SA?AVString@WTF@@PAVFrame@2@HHHHHHH@Z -
trunk/Source/autotools/symbols.filter
r127457 r127577 176 176 _ZN7WebCore26ContextDestructionObserverC2EPNS_22ScriptExecutionContextE; 177 177 _ZN7WebCore26ContextDestructionObserver16contextDestroyedEv; 178 _ZN7WebCore12PrintContext13numberOfPagesEPNS_5FrameERKNS_9FloatSizeE; 179 _ZN7WebCore12PrintContext12pagePropertyEPNS_5FrameEPKci; 180 _ZN7WebCore12PrintContext26pageSizeAndMarginsInPixelsEPNS_5FrameEiiiiiii; 178 181 179 182 local: -
trunk/Tools/ChangeLog
r127576 r127577 1 2012-09-05 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 3 [DRT] LTC:: Move printing related APIs from LayoutTestController to Internals 4 https://bugs.webkit.org/show_bug.cgi?id=92735 5 6 Reviewed by Hajime Morita. 7 8 Move numberOfPages, pageProperty & pageSizeAndMarginsInPixels in Internals and remove duplicated code from DumprenderTree & WebkitTestRunner. 9 10 * DumpRenderTree/TestRunner.cpp: 11 (TestRunner::staticFunctions): 12 * DumpRenderTree/TestRunner.h: 13 (TestRunner): 14 * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: 15 (TestRunner::addUserStyleSheet): 16 * DumpRenderTree/chromium/DRTTestRunner.cpp: 17 (DRTTestRunner::DRTTestRunner): 18 (DRTTestRunner::hasCustomPageSizeStyle): 19 * DumpRenderTree/chromium/DRTTestRunner.h: 20 (DRTTestRunner): 21 * DumpRenderTree/efl/TestRunnerEfl.cpp: 22 * DumpRenderTree/gtk/TestRunnerGtk.cpp: 23 * DumpRenderTree/mac/TestRunnerMac.mm: 24 * DumpRenderTree/qt/TestRunnerQt.cpp: 25 (TestRunner::evaluateScriptInIsolatedWorld): 26 * DumpRenderTree/qt/TestRunnerQt.h: 27 (TestRunner): 28 * DumpRenderTree/win/TestRunnerWin.cpp: 29 * DumpRenderTree/wx/TestRunnerWx.cpp: 30 (TestRunner::abortModal): 31 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 32 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 33 (WTR): 34 * WebKitTestRunner/InjectedBundle/TestRunner.h: 35 (TestRunner): 36 1 37 2012-09-05 Simon Hausmann <simon.hausmann@nokia.com> 2 38 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r127298 r127577 716 716 } 717 717 718 static bool parsePageParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, float& pageWidthInPixels, float& pageHeightInPixels)719 {720 pageWidthInPixels = TestRunner::maxViewWidth;721 pageHeightInPixels = TestRunner::maxViewHeight;722 switch (argumentCount) {723 case 2:724 pageWidthInPixels = static_cast<float>(JSValueToNumber(context, arguments[0], exception));725 if (*exception)726 return false;727 pageHeightInPixels = static_cast<float>(JSValueToNumber(context, arguments[1], exception));728 if (*exception)729 return false;730 case 0: // Fall through.731 break;732 default:733 return false;734 }735 return true;736 }737 738 // Caller needs to delete[] propertyName.739 static bool parsePagePropertyParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, char*& propertyName, int& pageNumber)740 {741 pageNumber = 0;742 switch (argumentCount) {743 case 2:744 pageNumber = static_cast<float>(JSValueToNumber(context, arguments[1], exception));745 if (*exception)746 return false;747 // Fall through.748 case 1: {749 JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSValueToStringCopy(context, arguments[0], exception));750 if (*exception)751 return false;752 753 size_t maxLength = JSStringGetMaximumUTF8CStringSize(propertyNameString.get());754 propertyName = new char[maxLength + 1];755 JSStringGetUTF8CString(propertyNameString.get(), propertyName, maxLength + 1);756 return true;757 }758 case 0:759 default:760 return false;761 }762 }763 764 static bool parsePageNumberSizeMarings(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, int& pageNumber, int& width, int& height, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft)765 {766 pageNumber = 0;767 width = height = 0;768 marginTop = marginRight = marginBottom = marginLeft = 0;769 770 switch (argumentCount) {771 case 7:772 marginLeft = static_cast<int>(JSValueToNumber(context, arguments[6], exception));773 if (*exception)774 return false;775 // Fall through.776 case 6:777 marginBottom = static_cast<int>(JSValueToNumber(context, arguments[5], exception));778 if (*exception)779 return false;780 // Fall through.781 case 5:782 marginRight = static_cast<int>(JSValueToNumber(context, arguments[4], exception));783 if (*exception)784 return false;785 // Fall through.786 case 4:787 marginTop = static_cast<int>(JSValueToNumber(context, arguments[3], exception));788 if (*exception)789 return false;790 // Fall through.791 case 3:792 height = static_cast<int>(JSValueToNumber(context, arguments[2], exception));793 if (*exception)794 return false;795 // Fall through.796 case 2:797 width = static_cast<int>(JSValueToNumber(context, arguments[1], exception));798 if (*exception)799 return false;800 // Fall through.801 case 1:802 pageNumber = static_cast<int>(JSValueToNumber(context, arguments[0], exception));803 if (*exception)804 return false;805 // Fall through.806 return true;807 default:808 return false;809 }810 }811 812 static JSValueRef numberOfPagesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)813 {814 float pageWidthInPixels = 0;815 float pageHeightInPixels = 0;816 if (!parsePageParameters(context, argumentCount, arguments, exception, pageWidthInPixels, pageHeightInPixels))817 return JSValueMakeUndefined(context);818 819 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));820 return JSValueMakeNumber(context, controller->numberOfPages(pageWidthInPixels, pageHeightInPixels));821 }822 823 718 static JSValueRef numberOfPendingGeolocationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 824 719 { 825 720 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 826 721 return JSValueMakeNumber(context, controller->numberOfPendingGeolocationPermissionRequests()); 827 }828 829 static JSValueRef pagePropertyCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)830 {831 char* propertyName = 0;832 int pageNumber = 0;833 if (!parsePagePropertyParameters(context, argumentCount, arguments, exception, propertyName, pageNumber))834 return JSValueMakeUndefined(context);835 836 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));837 JSValueRef value = JSValueMakeString(context, controller->pageProperty(propertyName, pageNumber).get());838 839 delete[] propertyName;840 return value;841 }842 843 static JSValueRef pageSizeAndMarginsInPixelsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)844 {845 int pageNumber = 0;846 int width = 0, height = 0;847 int marginTop = 0, marginRight = 0, marginBottom = 0, marginLeft = 0;848 if (!parsePageNumberSizeMarings(context, argumentCount, arguments, exception, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft))849 return JSValueMakeUndefined(context);850 851 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));852 return JSValueMakeString(context, controller->pageSizeAndMarginsInPixels(pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).get());853 722 } 854 723 … … 2348 2217 { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2349 2218 { "layerTreeAsText", layerTreeAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2350 { "numberOfPages", numberOfPagesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },2351 2219 { "numberOfPendingGeolocationPermissionRequests", numberOfPendingGeolocationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2352 2220 { "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, … … 2354 2222 { "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2355 2223 { "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2356 { "pageSizeAndMarginsInPixels", pageSizeAndMarginsInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },2357 { "pageProperty", pagePropertyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },2358 2224 { "pathToLocalResource", pathToLocalResourceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2359 2225 { "pauseAnimationAtTimeOnElementWithId", pauseAnimationAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/TestRunner.h
r127298 r127577 71 71 JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef); 72 72 void notifyDone(); 73 int numberOfPages(float pageWidthInPixels, float pageHeightInPixels);74 73 int numberOfPendingGeolocationPermissionRequests(); 75 74 void overridePreference(JSStringRef key, JSStringRef value); 76 JSRetainPtr<JSStringRef> pageProperty(const char* propertyName, int pageNumber) const;77 JSRetainPtr<JSStringRef> pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const;78 75 JSStringRef pathToLocalResource(JSContextRef, JSStringRef url); 79 76 void queueBackNavigation(int howFarBackward); -
trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
r126909 r127577 326 326 } 327 327 328 JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const329 {330 UNUSED_PARAM(propertyName);331 UNUSED_PARAM(pageNumber);332 notImplemented();333 return 0;334 }335 336 328 void TestRunner::setWaitToDump(bool waitToDump) 337 329 { … … 508 500 { 509 501 notImplemented(); 510 }511 512 JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int, int, int, int, int, int, int) const513 {514 notImplemented();515 return 0;516 }517 518 int TestRunner::numberOfPages(float, float)519 {520 notImplemented();521 return -1;522 502 } 523 503 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r127473 r127577 171 171 bindMethod("notifyDone", &DRTTestRunner::notifyDone); 172 172 bindMethod("numberOfActiveAnimations", &DRTTestRunner::numberOfActiveAnimations); 173 bindMethod("numberOfPages", &DRTTestRunner::numberOfPages);174 173 bindMethod("numberOfPendingGeolocationPermissionRequests", &DRTTestRunner:: numberOfPendingGeolocationPermissionRequests); 175 174 bindMethod("objCIdentityIsEqual", &DRTTestRunner::objCIdentityIsEqual); 176 175 bindMethod("overridePreference", &DRTTestRunner::overridePreference); 177 bindMethod("pageProperty", &DRTTestRunner::pageProperty);178 bindMethod("pageSizeAndMarginsInPixels", &DRTTestRunner::pageSizeAndMarginsInPixels);179 176 bindMethod("pathToLocalResource", &DRTTestRunner::pathToLocalResource); 180 177 bindMethod("pauseAnimationAtTimeOnElementWithId", &DRTTestRunner::pauseAnimationAtTimeOnElementWithId); … … 1695 1692 } 1696 1693 1697 static bool parsePageSizeParameters(const CppArgumentList& arguments,1698 int argOffset,1699 int* pageWidthInPixels,1700 int* pageHeightInPixels)1701 {1702 // WebKit is using the window width/height of DumpRenderTree as the1703 // default value of the page size.1704 // FIXME: share the default values with other ports.1705 int argCount = static_cast<int>(arguments.size()) - argOffset;1706 if (argCount && argCount != 2)1707 return false;1708 if (!parseCppArgumentInt32(arguments, argOffset, pageWidthInPixels, 800)1709 || !parseCppArgumentInt32(arguments, argOffset + 1, pageHeightInPixels, 600))1710 return false;1711 return true;1712 }1713 1714 1694 static bool parsePageNumber(const CppArgumentList& arguments, int argOffset, int* pageNumber) 1715 1695 { … … 1721 1701 } 1722 1702 1723 static bool parsePageNumberSizeMargins(const CppArgumentList& arguments, int argOffset,1724 int* pageNumber, int* width, int* height,1725 int* marginTop, int* marginRight, int* marginBottom, int* marginLeft)1726 {1727 int argCount = static_cast<int>(arguments.size()) - argOffset;1728 if (argCount && argCount != 7)1729 return false;1730 if (!parseCppArgumentInt32(arguments, argOffset, pageNumber, 0)1731 || !parseCppArgumentInt32(arguments, argOffset + 1, width, 0)1732 || !parseCppArgumentInt32(arguments, argOffset + 2, height, 0)1733 || !parseCppArgumentInt32(arguments, argOffset + 3, marginTop, 0)1734 || !parseCppArgumentInt32(arguments, argOffset + 4, marginRight, 0)1735 || !parseCppArgumentInt32(arguments, argOffset + 5, marginBottom, 0)1736 || !parseCppArgumentInt32(arguments, argOffset + 6, marginLeft, 0))1737 return false;1738 return true;1739 }1740 1741 1703 void DRTTestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result) 1742 1704 { 1743 1705 setIsPrinting(true); 1744 1706 result->setNull(); 1745 }1746 1747 void DRTTestRunner::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result)1748 {1749 result->set("");1750 int pageNumber = 0;1751 int width = 0;1752 int height = 0;1753 int marginTop = 0;1754 int marginRight = 0;1755 int marginBottom = 0;1756 int marginLeft = 0;1757 if (!parsePageNumberSizeMargins(arguments, 0, &pageNumber, &width, &height, &marginTop, &marginRight, &marginBottom,1758 &marginLeft))1759 return;1760 1761 WebFrame* frame = m_shell->webView()->mainFrame();1762 if (!frame)1763 return;1764 WebSize pageSize(width, height);1765 frame->pageSizeAndMarginsInPixels(pageNumber, pageSize, marginTop, marginRight, marginBottom, marginLeft);1766 stringstream resultString;1767 resultString << "(" << pageSize.width << ", " << pageSize.height << ") " << marginTop << " " << marginRight << " "1768 << marginBottom << " " << marginLeft;1769 result->set(resultString.str());1770 1707 } 1771 1708 … … 1780 1717 return; 1781 1718 result->set(frame->hasCustomPageSizeStyle(pageIndex)); 1782 }1783 1784 void DRTTestRunner::pageProperty(const CppArgumentList& arguments, CppVariant* result)1785 {1786 result->set("");1787 int pageNumber = 0;1788 if (!parsePageNumber(arguments, 1, &pageNumber))1789 return;1790 if (!arguments[0].isString())1791 return;1792 WebFrame* frame = m_shell->webView()->mainFrame();1793 if (!frame)1794 return;1795 WebSize pageSize(800, 800);1796 frame->printBegin(pageSize);1797 result->set(frame->pageProperty(cppVariantToWebString(arguments[0]), pageNumber).utf8());1798 frame->printEnd();1799 }1800 1801 void DRTTestRunner::numberOfPages(const CppArgumentList& arguments, CppVariant* result)1802 {1803 result->setNull();1804 int pageWidthInPixels = 0;1805 int pageHeightInPixels = 0;1806 if (!parsePageSizeParameters(arguments, 0, &pageWidthInPixels, &pageHeightInPixels))1807 return;1808 1809 WebFrame* frame = m_shell->webView()->mainFrame();1810 if (!frame)1811 return;1812 WebPrintParams printParams(WebSize(pageWidthInPixels, pageHeightInPixels));1813 int numberOfPages = frame->printBegin(printParams);1814 frame->printEnd();1815 result->set(numberOfPages);1816 1719 } 1817 1720 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r127473 r127577 315 315 void setPrinting(const CppArgumentList&, CppVariant*); 316 316 317 // Gets the page size and margins for a printed page.318 void pageSizeAndMarginsInPixels(const CppArgumentList&, CppVariant*);319 320 317 // Returns true if the current page box has custom page size style for 321 318 // printing. 322 319 void hasCustomPageSizeStyle(const CppArgumentList&, CppVariant*); 323 324 // Gets the page-related property for printed content325 void pageProperty(const CppArgumentList&, CppVariant*);326 327 // Gets the number of pages to be printed.328 void numberOfPages(const CppArgumentList&, CppVariant*);329 320 330 321 // Gets the number of geolocation permissions requests pending. -
trunk/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
r127024 r127577 124 124 } 125 125 126 int TestRunner::numberOfPages(float pageWidth, float pageHeight)127 {128 return DumpRenderTreeSupportEfl::numberOfPages(browser->mainFrame(), pageWidth, pageHeight);129 }130 131 JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const132 {133 const String property = DumpRenderTreeSupportEfl::pageProperty(browser->mainFrame(), propertyName, pageNumber);134 if (property.isEmpty())135 return 0;136 137 JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(property.utf8().data()));138 return propertyValue;139 }140 141 JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const142 {143 String pageSizeAndMargins = DumpRenderTreeSupportEfl::pageSizeAndMarginsInPixels(browser->mainFrame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);144 145 if (pageSizeAndMargins.isEmpty())146 return 0;147 148 JSRetainPtr<JSStringRef> returnValue(Adopt, JSStringCreateWithUTF8CString(pageSizeAndMargins.utf8().data()));149 return returnValue;150 }151 152 126 size_t TestRunner::webHistoryItemCount() 153 127 { -
trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp
r126909 r127577 118 118 JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString("")); 119 119 return string; 120 }121 122 int TestRunner::numberOfPages(float pageWidth, float pageHeight)123 {124 return DumpRenderTreeSupportGtk::numberOfPagesForFrame(mainFrame, pageWidth, pageHeight);125 }126 127 JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const128 {129 JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageProperty(mainFrame, propertyName, pageNumber).data()));130 return propertyValue;131 }132 133 JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const134 {135 JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(mainFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).data()));136 return propertyValue;137 120 } 138 121 -
trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm
r127298 r127577 286 286 } 287 287 288 JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const289 {290 JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageProperty:propertyName:pageNumber]));291 return propertyValue;292 }293 294 JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const295 {296 JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageSizeAndMarginsInPixels:pageNumber:width:height:marginTop:marginRight:marginBottom:marginLeft]));297 return propertyValue;298 }299 300 int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)301 {302 return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels];303 }304 305 288 int TestRunner::numberOfPendingGeolocationPermissionRequests() 306 289 { -
trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp
r126909 r127577 727 727 } 728 728 729 int TestRunner::numberOfPages(float width, float height)730 {731 return DumpRenderTreeSupportQt::numberOfPages(m_drt->webPage()->mainFrame(), width, height);732 }733 734 729 bool TestRunner::callShouldCloseOnWebView() 735 730 { … … 887 882 } 888 883 889 QString TestRunner::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)890 {891 return DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels(m_drt->webPage()->mainFrame(), pageIndex,892 width, height, marginTop, marginRight, marginBottom, marginLeft);893 }894 895 QString TestRunner::pageProperty(const QString& propertyName, int pageNumber)896 {897 return DumpRenderTreeSupportQt::pageProperty(m_drt->webPage()->mainFrame(), propertyName, pageNumber);898 }899 900 884 void TestRunner::addUserStyleSheet(const QString& sourceCode) 901 885 { -
trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h
r126909 r127577 215 215 void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme); 216 216 int workerThreadCount(); 217 int numberOfPages(float width = maxViewWidth, float height = maxViewHeight);218 217 bool callShouldCloseOnWebView(); 219 218 // For now, this is a no-op. This may change depending on outcome of … … 262 261 void evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script); 263 262 void evaluateScriptInIsolatedWorld(int worldID, const QString& script); 264 QString pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);265 QString pageProperty(const QString& propertyName, int pageNumber);266 263 void addUserStyleSheet(const QString& sourceCode); 267 264 -
trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp
r126926 r127577 1301 1301 } 1302 1302 1303 int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) 1303 void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) 1304 { 1305 1306 } 1307 1308 void TestRunner::apiTestGoToCurrentBackForwardItem() 1309 { 1310 COMPtr<IWebView> webView; 1311 if (FAILED(frame->webView(&webView))) 1312 return; 1313 1314 COMPtr<IWebBackForwardList> backForwardList; 1315 if (FAILED(webView->backForwardList(&backForwardList))) 1316 return; 1317 1318 COMPtr<IWebHistoryItem> item; 1319 if (FAILED(backForwardList->currentItem(&item))) 1320 return; 1321 1322 BOOL success; 1323 webView->goToBackForwardItem(item.get(), &success); 1324 } 1325 1326 void TestRunner::setWebViewEditable(bool) 1327 { 1328 } 1329 1330 void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) 1331 { 1332 } 1333 1334 void TestRunner::abortModal() 1335 { 1336 } 1337 1338 void TestRunner::setSerializeHTTPLoads(bool) 1339 { 1340 // FIXME: Implement. 1341 } 1342 1343 void TestRunner::syncLocalStorage() 1344 { 1345 // FIXME: Implement. 1346 } 1347 1348 void TestRunner::observeStorageTrackerNotifications(unsigned number) 1349 { 1350 // FIXME: Implement. 1351 } 1352 1353 void TestRunner::deleteAllLocalStorage() 1354 { 1355 // FIXME: Implement. 1356 } 1357 1358 JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) 1359 { 1360 // FIXME: Implement. 1361 return JSValueMakeUndefined(context); 1362 } 1363 1364 long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) 1365 { 1366 // FIXME: Implement to support getting local storage disk usage for an origin. 1367 return 0; 1368 } 1369 1370 void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) 1371 { 1372 // FIXME: Implement. 1373 } 1374 1375 void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) 1376 { 1377 COMPtr<IWebView> webView; 1378 if (FAILED(frame->webView(&webView))) 1379 return; 1380 1381 COMPtr<IWebViewPrivate> viewPrivate(Query, webView); 1382 if (!viewPrivate) 1383 return; 1384 1385 viewPrivate->setMinimumTimerInterval(minimumTimerInterval); 1386 } 1387 1388 void TestRunner::setTextDirection(JSStringRef direction) 1304 1389 { 1305 1390 COMPtr<IWebFramePrivate> framePrivate(Query, frame); 1306 1391 if (!framePrivate) 1307 return 0; 1308 1309 int pageNumber = -1; 1310 if (FAILED(framePrivate->numberOfPages(pageWidthInPixels, pageHeightInPixels, &pageNumber))) 1311 pageNumber = -1; 1312 return pageNumber; 1313 } 1314 1315 JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const 1392 return; 1393 1394 framePrivate->setTextDirection(bstrT(direction).GetBSTR()); 1395 } 1396 1397 void TestRunner::addChromeInputField() 1398 { 1399 } 1400 1401 void TestRunner::removeChromeInputField() 1402 { 1403 } 1404 1405 void TestRunner::focusWebView() 1406 { 1407 } 1408 1409 void TestRunner::setBackingScaleFactor(double) 1410 { 1411 } 1412 1413 void TestRunner::grantWebNotificationPermission(JSStringRef origin) 1414 { 1415 } 1416 1417 void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) 1418 { 1419 } 1420 1421 void TestRunner::removeAllWebNotificationPermissions() 1422 { 1423 } 1424 1425 void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification) 1426 { 1427 } 1428 1429 void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title) 1430 { 1431 // FIXME: Implement. 1432 } 1433 1434 void TestRunner::resetPageVisibility() 1316 1435 { 1317 1436 // FIXME: Implement this. 1318 return JSRetainPtr<JSStringRef>(); 1319 } 1320 1321 void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) 1322 { 1323 1324 } 1325 1326 JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const 1327 { 1328 // FIXME: implement 1329 return JSRetainPtr<JSStringRef>(); 1330 } 1331 1332 void TestRunner::apiTestGoToCurrentBackForwardItem() 1333 { 1334 COMPtr<IWebView> webView; 1335 if (FAILED(frame->webView(&webView))) 1336 return; 1337 1338 COMPtr<IWebBackForwardList> backForwardList; 1339 if (FAILED(webView->backForwardList(&backForwardList))) 1340 return; 1341 1342 COMPtr<IWebHistoryItem> item; 1343 if (FAILED(backForwardList->currentItem(&item))) 1344 return; 1345 1346 BOOL success; 1347 webView->goToBackForwardItem(item.get(), &success); 1348 } 1349 1350 void TestRunner::setWebViewEditable(bool) 1351 { 1352 } 1353 1354 void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) 1355 { 1356 } 1357 1358 void TestRunner::abortModal() 1359 { 1360 } 1361 1362 void TestRunner::setSerializeHTTPLoads(bool) 1363 { 1364 // FIXME: Implement. 1365 } 1366 1367 void TestRunner::syncLocalStorage() 1368 { 1369 // FIXME: Implement. 1370 } 1371 1372 void TestRunner::observeStorageTrackerNotifications(unsigned number) 1373 { 1374 // FIXME: Implement. 1375 } 1376 1377 void TestRunner::deleteAllLocalStorage() 1378 { 1379 // FIXME: Implement. 1380 } 1381 1382 JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) 1383 { 1384 // FIXME: Implement. 1385 return JSValueMakeUndefined(context); 1386 } 1387 1388 long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) 1389 { 1390 // FIXME: Implement to support getting local storage disk usage for an origin. 1391 return 0; 1392 } 1393 1394 void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) 1395 { 1396 // FIXME: Implement. 1397 } 1398 1399 void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) 1400 { 1401 COMPtr<IWebView> webView; 1402 if (FAILED(frame->webView(&webView))) 1403 return; 1404 1405 COMPtr<IWebViewPrivate> viewPrivate(Query, webView); 1406 if (!viewPrivate) 1407 return; 1408 1409 viewPrivate->setMinimumTimerInterval(minimumTimerInterval); 1410 } 1411 1412 void TestRunner::setTextDirection(JSStringRef direction) 1413 { 1414 COMPtr<IWebFramePrivate> framePrivate(Query, frame); 1415 if (!framePrivate) 1416 return; 1417 1418 framePrivate->setTextDirection(bstrT(direction).GetBSTR()); 1419 } 1420 1421 void TestRunner::addChromeInputField() 1422 { 1423 } 1424 1425 void TestRunner::removeChromeInputField() 1426 { 1427 } 1428 1429 void TestRunner::focusWebView() 1430 { 1431 } 1432 1433 void TestRunner::setBackingScaleFactor(double) 1434 { 1435 } 1436 1437 void TestRunner::grantWebNotificationPermission(JSStringRef origin) 1438 { 1439 } 1440 1441 void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) 1442 { 1443 } 1444 1445 void TestRunner::removeAllWebNotificationPermissions() 1446 { 1447 } 1448 1449 void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification) 1450 { 1451 } 1452 1453 void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title) 1454 { 1455 // FIXME: Implement. 1456 } 1457 1458 void TestRunner::resetPageVisibility() 1437 } 1438 1439 void TestRunner::setPageVisibility(const char*) 1459 1440 { 1460 1441 // FIXME: Implement this. 1461 1442 } 1462 1443 1463 void TestRunner::set PageVisibility(const char*)1444 void TestRunner::setAutomaticLinkDetectionEnabled(bool) 1464 1445 { 1465 1446 // FIXME: Implement this. 1466 1447 } 1467 1448 1468 void TestRunner::se tAutomaticLinkDetectionEnabled(bool)1449 void TestRunner::sendWebIntentResponse(JSStringRef) 1469 1450 { 1470 1451 // FIXME: Implement this. 1471 1452 } 1472 1453 1473 void TestRunner:: sendWebIntentResponse(JSStringRef)1454 void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) 1474 1455 { 1475 1456 // FIXME: Implement this. 1476 1457 } 1477 1458 1478 void TestRunner:: deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)1459 void TestRunner::setStorageDatabaseIdleInterval(double) 1479 1460 { 1480 1461 // FIXME: Implement this. 1481 1462 } 1482 1483 void TestRunner::setStorageDatabaseIdleInterval(double)1484 {1485 // FIXME: Implement this.1486 } -
trunk/Tools/DumpRenderTree/wx/TestRunnerWx.cpp
r125516 r127577 473 473 } 474 474 475 int TestRunner::numberOfPages(float, float)476 {477 // FIXME: implement478 return -1;479 }480 481 475 void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) 482 476 { … … 524 518 void TestRunner::abortModal() 525 519 { 526 }527 528 JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const529 {530 // FIXME: Implement531 return 0;532 }533 534 JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const535 {536 // FIXME: Implement537 return 0;538 520 } 539 521 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r127026 r127577 85 85 86 86 // Printing 87 int numberOfPages(in double pageWidthInPixels, in double pageHeightInPixels);88 DOMString pageSizeAndMarginsInPixels(in int pageIndex, in int width, in int height, in int marginTop, in int marginRight, in int marginBottom, in int marginLeft);89 87 boolean isPageBoxVisible(in int pageIndex); 90 88 -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r127026 r127577 379 379 } 380 380 381 int TestRunner::numberOfPages(double pageWidthInPixels, double pageHeightInPixels)382 {383 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());384 return WKBundleNumberOfPages(InjectedBundle::shared().bundle(), mainFrame, pageWidthInPixels, pageHeightInPixels);385 }386 387 JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)388 {389 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());390 return toJS(WKBundlePageSizeAndMarginsInPixels(InjectedBundle::shared().bundle(), mainFrame, pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft));391 }392 393 381 bool TestRunner::isPageBoxVisible(int pageIndex) 394 382 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r127026 r127577 146 146 147 147 // Printing 148 int numberOfPages(double pageWidthInPixels, double pageHeightInPixels);149 JSRetainPtr<JSStringRef> pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);150 148 bool isPageBoxVisible(int pageIndex); 151 149
Note: See TracChangeset
for help on using the changeset viewer.