SlideShare a Scribd company logo
1 of 30
Download to read offline
How I stopped worrying
  and
  loved DumpRenderTree


                                                   2011/03/08
                         MORITA Hajime <omo@dodgson.org>
                                     http://steps.dodgson.org/

Tuesday, March 8, 2011
How I stopped worrying
  and
  loved DumpRenderTree
                                                          a bit



                                                   2011/03/08
                         MORITA Hajime <omo@dodgson.org>
                                     http://steps.dodgson.org/

Tuesday, March 8, 2011
• WebKit
                         Test Smell


                    •    .js   Test

                    •                 (   )




Tuesday, March 8, 2011
DumpRenderTree (DRT)
                 Demo




Tuesday, March 8, 2011
DumpRenderTree (DRT)

                    •
                    • HTML
                                                (   )



                    •           “Golden File”

                         • OS
Tuesday, March 8, 2011
(-2002)


                    •
                         •   DumpRenderTree, LayoutTest

                    •    WebKit      Mac




Tuesday, March 8, 2011
Mac
      •       JavaScript / DOM

      •       ex: ws://

      •                                         •   OS/GUI
                                                    Win, Qt, GTK, EFL, Skia ...
                                                                                  (Ports)
              ex: -webkit-transition:

      •       OS,                               •   Mac
                                                    Tiger, Leopard, SL, Lion
              ex: drag-n-drop, media, storage

      •       ex: <input type=”speech”>

      •       WYSIWYG
              contentEditable
Tuesday, March 8, 2011
3 Test Smells in WebKit


                    • Obscure Tests
                    • Fragile Tests
                    • High Test Maintenance Cost


Tuesday, March 8, 2011
(1/3): Obscure Tests
                                                   Dump?


                    • JavaScript
                    • HTML5-ish (File, XHR, WebSocket, etc.)
                    •


Tuesday, March 8, 2011
LayoutTestController.dumpAsText()
     if (window.layoutTestController) {
         layoutTestController.dumpAsText();
         ...
     }

     function log(msg)
     {
         document.getElementById('log').innerHTML += (msg + “n”);
     }

     ...
               sel = window.getSelection();
               actualText = sel.getRangeAt(0).toString();

               if (expectedText == actualText) {
                   log("Passed " + testId + " (with contentEditable)");
               } else {
                   log("Failed " + testId + " (with contentEditable)");
                   log(" Expected: " + expectedText);
                   log(" Actual: " + actualText);
               }
     ...
Tuesday, March 8, 2011
:
  Passed           totest_minimum
  Passed           totest_minimum (with contentEditable)
  Passed           totest_before_after
  Passed           totest_before_after (with contentEditable)
  Passed           totest_linebreak_out
  Passed           totest_linebreak_out (with contentEditable)
  Passed           totest_tab_out
  Passed           totest_tab_out (with contentEditable)
  Passed           totest_multiple_whitespaces_out
  Passed           totest_multiple_whitespaces_out (with contentEditable)
  Passed           totest_linebreak_in
  Passed           totest_linebreak_in (with contentEditable)



         •
         •               Port

Tuesday, March 8, 2011
(1/3): Obscure Tests

                    • LayoutTestController.dumpAsText()
                    • js-test-pre.js/js-test-post.js
                      assertion

                    • dump-as-markup.js w/ dumpAsText())
                      DOM         (built
                         contentEditable




Tuesday, March 8, 2011
(2/3): Fragile Tests
                Golden File          : Over specification
                    •
                         •     OS

                         •      OS
                         •
                    •    GPU
                    •
                    •    DRT


Tuesday, March 8, 2011
Tree Redness




                               http://build.webkit.org/waterfall

            •                              (      )

            •
Tuesday, March 8, 2011
“Skipped” list
                Port


                    •                             (=           )
                    •
                    •                                  (   )
                         •   Bug = TODO list
                         •
                    •        Port   Golden File                    ...


Tuesday, March 8, 2011
Rebaselining Tool                             (Chromium only)



                                       script
                            Download            Update
                                                               Commit (by dev)


                                                         ...                          ...
                                                    expected.txt                 expected.txt
                         result.zip                      ...                          ...


                         Buildbot                 Local PC                         SVN
                          Server




Tuesday, March 8, 2011
(3/3): High Test Maintenance Cost


                    •                 Golden Files
                    •
                    •
                    •          Port

                    •    ...




Tuesday, March 8, 2011
Gardener (for Chromium)
                 •       Rebaseline, Skip, Revert, ..

                 •




Tuesday, March 8, 2011
Reftests (work in progress)

                    •                HTML

                    •    Port
                    •    Mozilla
                         https://developer.mozilla.org/en/Creating_reftest-based_unit_tests

                         •   W3C




Tuesday, March 8, 2011
• WebKit
                         Test Smell




Tuesday, March 8, 2011
Backup Slides



Tuesday, March 8, 2011
7 Test Smells in WebKit
                 • Obscure Tests
                 • Fragile Tests
                 • Erratic Tests
                 • Manual Intervention
                 • Slow Tests
                 • High Test Maintenance Cost
                 • Developers Not Writing (Unit) Tests
Tuesday, March 8, 2011
(x/x): Erratic Tests      aka. Flaky Tests




                    •
                    •    OS   (           )

                    •
                    •
                    •             ... (                      )




Tuesday, March 8, 2011
(Chromium only)




                                   unexpected flaky 1




                          http://build.chromium.org/p/chromium.webkit/waterfall
Tuesday, March 8, 2011
(x/x): Manual Intervention
                             JS

                    •
                    •    DOM

                         •   ex:
                    •



Tuesday, March 8, 2011
DRT      API
    // from editing/input/emacs-ctrl-o.html
    ...
        if (window.eventSender)
            eventSender.keyDown("o", ["ctrlKey"]);
    ...
    // from editing/spelling/.../spelling-attribute-at-child.js
    ...
        var marked = layoutTestController.hasSpellingMarker(1, 2);
    ...
     // from fast/speech/input-onspeechchange-event.html
     ...
         if (window.layoutTestController && window.eventSender) {
             layoutTestController.addMockSpeechInputResult(....);
     ...




Tuesday, March 8, 2011
...




Tuesday, March 8, 2011
(x/x): Slow Tests


                    •    2
                    •        HTML/JS




Tuesday, March 8, 2011
...

                    •    GUI
                                   : “Active Window”, “Clipboard”, ...
                    •                          (ex. localStorage)

                    •                      (                             )

                    •    Chromium WebKit
                         •   Window-less by design
                         •   ...


Tuesday, March 8, 2011
$ ./Tools/Scripts/run-webkit-tests --help
     Usage: old-run-webkit-tests [options] [testdir|testpath ...]
       ....
       --slowest Report the 10 slowest tests
       ....




Tuesday, March 8, 2011

More Related Content

Similar to How I stopped worrying about and loved DumpRenderTree

Introduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyIntroduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyRobert Viseur
 
Odnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureOdnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureDmitry Buzdin
 
HTML5: Building the Next Generation of Web Applications
HTML5: Building the Next Generation of Web ApplicationsHTML5: Building the Next Generation of Web Applications
HTML5: Building the Next Generation of Web ApplicationsChrome Developer Relations
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalkstoJason Diller
 
Big Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a BudgetBig Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a BudgetJoshua L. Davis
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGuillaume Laforge
 
HTML XHTML HTML5
HTML XHTML HTML5HTML XHTML HTML5
HTML XHTML HTML5timstone
 
Building a Testable Data Access Layer
Building a Testable Data Access LayerBuilding a Testable Data Access Layer
Building a Testable Data Access LayerTodd Anglin
 
Xavier Lacot: Abstracting Databases Access in Titanium Mobile
Xavier Lacot: Abstracting Databases Access in Titanium MobileXavier Lacot: Abstracting Databases Access in Titanium Mobile
Xavier Lacot: Abstracting Databases Access in Titanium MobileAxway Appcelerator
 
Black Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data RetrievalBlack Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data Retrievalqqlan
 
2011 codestrong-abstracting-databases-access-in-titanium-mobile
2011 codestrong-abstracting-databases-access-in-titanium-mobile2011 codestrong-abstracting-databases-access-in-titanium-mobile
2011 codestrong-abstracting-databases-access-in-titanium-mobileAxway Appcelerator
 
Abstracting databases access in Titanium Mobile
Abstracting databases access in Titanium MobileAbstracting databases access in Titanium Mobile
Abstracting databases access in Titanium MobileXavier Lacot
 
Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Bachkoutou Toutou
 
Kubernetes at Telekom Austria Group
Kubernetes at Telekom Austria Group Kubernetes at Telekom Austria Group
Kubernetes at Telekom Austria Group Oliver Moser
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...Dataconomy Media
 

Similar to How I stopped worrying about and loved DumpRenderTree (20)

Introduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyIntroduction to libre « fulltext » technology
Introduction to libre « fulltext » technology
 
Odnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureOdnoklassniki.ru Architecture
Odnoklassniki.ru Architecture
 
What's New in GWT 2.2
What's New in GWT 2.2What's New in GWT 2.2
What's New in GWT 2.2
 
HTML5: Building the Next Generation of Web Applications
HTML5: Building the Next Generation of Web ApplicationsHTML5: Building the Next Generation of Web Applications
HTML5: Building the Next Generation of Web Applications
 
Node js techtalksto
Node js techtalkstoNode js techtalksto
Node js techtalksto
 
Big Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a BudgetBig Bad PostgreSQL: BI on a Budget
Big Bad PostgreSQL: BI on a Budget
 
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume LaforgeGaelyk - SpringOne2GX - 2010 - Guillaume Laforge
Gaelyk - SpringOne2GX - 2010 - Guillaume Laforge
 
C Sharp Crash Course
C Sharp Crash CourseC Sharp Crash Course
C Sharp Crash Course
 
sidje
sidjesidje
sidje
 
HTML XHTML HTML5
HTML XHTML HTML5HTML XHTML HTML5
HTML XHTML HTML5
 
Tim stone.html5.rjug.20110316
Tim stone.html5.rjug.20110316Tim stone.html5.rjug.20110316
Tim stone.html5.rjug.20110316
 
Building a Testable Data Access Layer
Building a Testable Data Access LayerBuilding a Testable Data Access Layer
Building a Testable Data Access Layer
 
Xavier Lacot: Abstracting Databases Access in Titanium Mobile
Xavier Lacot: Abstracting Databases Access in Titanium MobileXavier Lacot: Abstracting Databases Access in Titanium Mobile
Xavier Lacot: Abstracting Databases Access in Titanium Mobile
 
Black Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data RetrievalBlack Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data Retrieval
 
2011 codestrong-abstracting-databases-access-in-titanium-mobile
2011 codestrong-abstracting-databases-access-in-titanium-mobile2011 codestrong-abstracting-databases-access-in-titanium-mobile
2011 codestrong-abstracting-databases-access-in-titanium-mobile
 
Abstracting databases access in Titanium Mobile
Abstracting databases access in Titanium MobileAbstracting databases access in Titanium Mobile
Abstracting databases access in Titanium Mobile
 
Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011
 
Kubernetes at Telekom Austria Group
Kubernetes at Telekom Austria Group Kubernetes at Telekom Austria Group
Kubernetes at Telekom Austria Group
 
JavaOne_2010
JavaOne_2010JavaOne_2010
JavaOne_2010
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
 

More from Hajime Morrita

More from Hajime Morrita (7)

On Web Browsers
On Web BrowsersOn Web Browsers
On Web Browsers
 
A Life of breakpoint
A Life of breakpointA Life of breakpoint
A Life of breakpoint
 
Binaries Are Not Only Output
Binaries Are Not Only OutputBinaries Are Not Only Output
Binaries Are Not Only Output
 
Stop Monkeys Fall
Stop Monkeys FallStop Monkeys Fall
Stop Monkeys Fall
 
clang-intro
clang-introclang-intro
clang-intro
 
devsummit2009js
devsummit2009jsdevsummit2009js
devsummit2009js
 
object-shapes
object-shapesobject-shapes
object-shapes
 

How I stopped worrying about and loved DumpRenderTree

  • 1. How I stopped worrying and loved DumpRenderTree 2011/03/08 MORITA Hajime <omo@dodgson.org> http://steps.dodgson.org/ Tuesday, March 8, 2011
  • 2. How I stopped worrying and loved DumpRenderTree a bit 2011/03/08 MORITA Hajime <omo@dodgson.org> http://steps.dodgson.org/ Tuesday, March 8, 2011
  • 3. • WebKit Test Smell • .js Test • ( ) Tuesday, March 8, 2011
  • 4. DumpRenderTree (DRT) Demo Tuesday, March 8, 2011
  • 5. DumpRenderTree (DRT) • • HTML ( ) • “Golden File” • OS Tuesday, March 8, 2011
  • 6. (-2002) • • DumpRenderTree, LayoutTest • WebKit Mac Tuesday, March 8, 2011
  • 7. Mac • JavaScript / DOM • ex: ws:// • • OS/GUI Win, Qt, GTK, EFL, Skia ... (Ports) ex: -webkit-transition: • OS, • Mac Tiger, Leopard, SL, Lion ex: drag-n-drop, media, storage • ex: <input type=”speech”> • WYSIWYG contentEditable Tuesday, March 8, 2011
  • 8. 3 Test Smells in WebKit • Obscure Tests • Fragile Tests • High Test Maintenance Cost Tuesday, March 8, 2011
  • 9. (1/3): Obscure Tests Dump? • JavaScript • HTML5-ish (File, XHR, WebSocket, etc.) • Tuesday, March 8, 2011
  • 10. LayoutTestController.dumpAsText() if (window.layoutTestController) { layoutTestController.dumpAsText(); ... } function log(msg) { document.getElementById('log').innerHTML += (msg + “n”); } ... sel = window.getSelection(); actualText = sel.getRangeAt(0).toString(); if (expectedText == actualText) { log("Passed " + testId + " (with contentEditable)"); } else { log("Failed " + testId + " (with contentEditable)"); log(" Expected: " + expectedText); log(" Actual: " + actualText); } ... Tuesday, March 8, 2011
  • 11. : Passed totest_minimum Passed totest_minimum (with contentEditable) Passed totest_before_after Passed totest_before_after (with contentEditable) Passed totest_linebreak_out Passed totest_linebreak_out (with contentEditable) Passed totest_tab_out Passed totest_tab_out (with contentEditable) Passed totest_multiple_whitespaces_out Passed totest_multiple_whitespaces_out (with contentEditable) Passed totest_linebreak_in Passed totest_linebreak_in (with contentEditable) • • Port Tuesday, March 8, 2011
  • 12. (1/3): Obscure Tests • LayoutTestController.dumpAsText() • js-test-pre.js/js-test-post.js assertion • dump-as-markup.js w/ dumpAsText()) DOM (built contentEditable Tuesday, March 8, 2011
  • 13. (2/3): Fragile Tests Golden File : Over specification • • OS • OS • • GPU • • DRT Tuesday, March 8, 2011
  • 14. Tree Redness http://build.webkit.org/waterfall • ( ) • Tuesday, March 8, 2011
  • 15. “Skipped” list Port • (= ) • • ( ) • Bug = TODO list • • Port Golden File ... Tuesday, March 8, 2011
  • 16. Rebaselining Tool (Chromium only) script Download Update Commit (by dev) ... ... expected.txt expected.txt result.zip ... ... Buildbot Local PC SVN Server Tuesday, March 8, 2011
  • 17. (3/3): High Test Maintenance Cost • Golden Files • • • Port • ... Tuesday, March 8, 2011
  • 18. Gardener (for Chromium) • Rebaseline, Skip, Revert, .. • Tuesday, March 8, 2011
  • 19. Reftests (work in progress) • HTML • Port • Mozilla https://developer.mozilla.org/en/Creating_reftest-based_unit_tests • W3C Tuesday, March 8, 2011
  • 20. • WebKit Test Smell Tuesday, March 8, 2011
  • 22. 7 Test Smells in WebKit • Obscure Tests • Fragile Tests • Erratic Tests • Manual Intervention • Slow Tests • High Test Maintenance Cost • Developers Not Writing (Unit) Tests Tuesday, March 8, 2011
  • 23. (x/x): Erratic Tests aka. Flaky Tests • • OS ( ) • • • ... ( ) Tuesday, March 8, 2011
  • 24. (Chromium only) unexpected flaky 1 http://build.chromium.org/p/chromium.webkit/waterfall Tuesday, March 8, 2011
  • 25. (x/x): Manual Intervention JS • • DOM • ex: • Tuesday, March 8, 2011
  • 26. DRT API // from editing/input/emacs-ctrl-o.html ... if (window.eventSender) eventSender.keyDown("o", ["ctrlKey"]); ... // from editing/spelling/.../spelling-attribute-at-child.js ... var marked = layoutTestController.hasSpellingMarker(1, 2); ... // from fast/speech/input-onspeechchange-event.html ... if (window.layoutTestController && window.eventSender) { layoutTestController.addMockSpeechInputResult(....); ... Tuesday, March 8, 2011
  • 28. (x/x): Slow Tests • 2 • HTML/JS Tuesday, March 8, 2011
  • 29. ... • GUI : “Active Window”, “Clipboard”, ... • (ex. localStorage) • ( ) • Chromium WebKit • Window-less by design • ... Tuesday, March 8, 2011
  • 30. $ ./Tools/Scripts/run-webkit-tests --help Usage: old-run-webkit-tests [options] [testdir|testpath ...] .... --slowest Report the 10 slowest tests .... Tuesday, March 8, 2011