Writing Tools using WebKit

Post on 24-May-2015

1.630 views 0 download

Tags:

description

Slides from the Pivotal Labs Tech Talk

Transcript of Writing Tools using WebKit

Writing Toolsusing WebKit

ARIYA HIDAYATENGINEERING DIRECTOR, SENCHA

whoami

Let’s Start the PARTY

Let’s Start the PARTY

Unintentional Regression

This is awesome!

forget to run

the tests

REGRESSION

Unintentional Regression

This is awesome!

forget to run

the tests

REGRESSION

Unintentional Regression

This is awesome!

Pre-commit hook tocommand line test runner

Using WebView

QWebView webView;webView.show();webView.setUrl(QUrl("http://www.sencha.com"));

Capture to Image

QWebPage page;QImage image(size, QImage::Format_ARGB32_Premultiplied);image.fill(Qt::transparent);QPainter p(&image);page.mainFrame()->render(&p);p.end();image.save(fileName);

Test Runner

specrunner SpecRunner.html5 specs, 0 failures in 0.013s

specrunner SpecRunner.htmlFAIL: 5 specs, 1 failure in 0.014s

Network Log

28: GET http://www.google.com/m/gp292: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp311: GET data:image/gif;base64,R0lGODlhiA...312: GET data:image/gif;base64,R0lGODlhJA...312: GET data:image/gif;base64,R0lGODlhGA...312: Response 0 image/gif 3611 bytes data:image/gif;base64,R0lGODlhiA...312: Finish fail data:image/gif;base64,R0lGODlhiA...312: Response 0 image/gif 284 bytes data:image/gif;base64,R0lGODlhJA...312: Finish fail data:image/gif;base64,R0lGODlhJA...312: Response 0 image/gif 178 bytes data:image/gif;base64,R0lGODlhGA...312: Finish fail data:image/gif;base64,R0lGODlhGA...317: Response 200 application/xhtml+xml; charset=UTF-8 0 bytes http://www.google.com/m/gp324: Finish fail http://www.google.com/m/gp328: GET http://www.google.com/m/gn/user?...329: Finish success http://www.google.com/m/gn/user?...

Recorder & Replayer

Remote Console for

http://github.com/senchalabs/android-tools

Remote Console for

http://github.com/senchalabs/android-tools

THANK YOU!

QUESTIONS?

ariya @ sencha.com

ariyahidayat

ariya.blogspot.com

ADDENDUM

Around the Project

0

10000

20000

30000

40000

50000

60000

70000

80000

0 1 2 3 4 5 6 7 8 9 10

Rev

isio

ns

Years

History

0

10000

20000

30000

40000

50000

60000

70000

80000

0 1 2 3 4 5 6 7 8 9 10

Rev

isio

ns

Years

History~2000 commits/month

Level of Involvement

Contributor

Committer

≈ 130 Reviewer

≈ 80accept or reject patches

checks in reviewed patches

after 10-20 patches

after 80 patches

WebKit ReviewersApple

38

Google19

Nokia7

RIM6

Misc12

WebKit ReviewersApple

38

Google19

Nokia7

RIM6

Misc12

1

Components of WebKit

WebKit Library

JavaScriptCore

WebCore

HTML rendering

SVG

DOM CSS

Platform Abstractions

Network Unicode Clipboard

Graphics Theme Events

Thread Geolocation Timer

Di!erent “Ports”WebCore graphics

Mac Chromium Qt Gtk

CoreGraphics

Skia

QPainter

Cairo

graphics stack

GraphicsContext

Web Browsers

Safari

WebCore + JavaScriptCore

Eclair

WebCore + V8

Chrome Froyo

WebKit Everywhere

Browser

Devices

Runtime

How Fresh?

Fall 2010Spring 2010

Chrome 7534.7

Safari 5533.18

Android 2.2533.1

Safari 4528.16

AIR 2.5531.9

mid 2009

Extensive Tests

the rest229 MB

tests904 MB≈ 20,000 tests

Workflow

1Every commit needs to be reviewed

2 Broken commit must be reverted

Workflow

1Every commit needs to be reviewed

2 Broken commit must be reverted

quality control

zero-regression policy

Get + Build + Launch

Requirements

• Subversion or Git• C++ compiler• Perl• Python• Various SDK

Using Subversion

svn checkout http://svn.webkit.org/repository/webkit/trunk webkitcd webkit

≈ 880 MB .svn

Using git

git clone git://git.webkit.org/WebKit.gitcd WebKit

≈ 1.2 GB .git

Build

WebKitTools/Scripts/build-webkit

--qt for Qt, --gtk for Gtk+--debug for “Debug” mode

Launch

WebKitTools/Scripts/run-launcher

--qt for Qt, --gtk for Gtk+--debug for “Debug” mode