mitcho Michael 芳貴 Erlewine

Linguist. Fifth year PhD student at MIT.

blog

Posts Tagged ‘Firefox’

Checking mochitest test coverage

Tuesday, March 22nd, 2011

Firefox Download ButtonOne of the last bugs for Firefox Panorama was bug 625818: “Check Panorama mochitest test suite coverage”. Our automated tests ensure that we do not regress on existing functionality, but it’s only as good as its coverage: how much of the Panorama code base is actually being “hit” through the process of running the test suite.

Panorama went through a pretty rapid development cycle, making it into Firefox 4 which was released today (yay!). Moreover, for a while we were developing outside of mozilla-central, without the regular “patches require tests” requirement. This makes checking its test coverage particularly important.

Check out the final result, the Panorama test coverage report. The good news: our code coverage is 86%! (Some notes on what improvements can be made are in the bug.)

code coverage report

PhiliKON had previously worked on hooking into the JS Debugger service’s interruptHook to test xpcshell tests. I modified this code to run instead in the Mochitest browser chrome tests. This code can be found on the bug.

With this patch applied, I invoked the test suite with the following code: TEST_PATH=browser/base/content/tests/tabview COVERAGE_FILTER="*tabview*" COVERAGE=true make -C obj-ff-dbg mochitest-browser-chrome . That’s a regular mochitest-browser-chrome invocation with the COVERAGE=true flag which turns on code coverage checking, and COVERAGE_FILTER=*tabview* which filters out results from files which don’t have “tabview” in their paths. This creates a file called coverage.json in the working directory of the test suite, meaning, for me, obj-ff-dbg/_tests/testing/mochitest/.

This JSON file is a multidimensional array, with file paths and then line numbers as keys. The file paths here, as best as possible, have been converted into local filesystem paths. PhiliKON built a script which produces beautiful reports based on this output.

A word of warning: running with this JSD interruptHook is ridiculously slow. A number of tests for Panorama are timing-dependent (drag-drop tests, for example), making some of them fail, but that’s okay… as long as it completed not via a timeout, it actually did run through all the code. In order to get this to run through everything with some degree of control, I split up the mochitest tabview suite in to a few chunks. I then took the multiple resulting coverage.json files and passed them into another script, in tools/coverage/aggregate.py, which takes multiple JSON results like this and puts them together into a single JSON file. I then passed this aggregate JSON file to PhiliKON’s wonderful report script and—voila—the Panorama test coverage report! Easy as pie.

Happy Halloween!

Friday, October 29th, 2010

Happy Halloween from the Firefox Panorama team!

We carved some pumpkins a couple days ago in my department. I carved the Panorama logo above, but also one of the Stata Center.

More Jack-O-Lantern photos, including great ones of Chomsky and Norvin Richards, are up on Flickr.

After the Deadline for Firefox

Monday, February 1st, 2010

After the Deadline is a powerful and intelligent proofreading tool which checks for spelling errors, misused words, some grammatical gaffes, and even some stylistic issues. For the past month, I’ve been working for Automattic, the company behind AtD and the makers of WordPress.com, to create a Firefox add-on which enables this superior technology everywhere on the web. Words can’t do justice to the magic that is AtD, so here’s a video we put together:

I invite you all to give it a spin:

add-add-on.png

Working on After the Deadline for Firefox gave me my first experience creating an add-on from the ground up and I’ve learned a lot. After working on Ubiquity and dabbling with Jetpack, it’s given me another perspective on extensibility on the web and I look forward to thinking and writing more about these experiences in the near future.

In the mean time, happy proofreading! :D

Light of Firefox (tomoshibi 灯) from Mozilla Japan

Tuesday, June 30th, 2009

Here at Mozilla Japan Firefox 3.5 Headquarters,1 we just launched the new and improved Light of Firefox (in Japanese, tomoshibi (灯)) for Firefox 3.5. The Light of Firefox is a real-time, interactive website which shows sparks on a map of Japan for every manual download of the new Firefox from mozilla.jp.

tomoshibi-medium.png

The name tomoshibi means “torch” in Japanese. As a new Firefox brings new technologies and possibilities to all corners of the web, so too will the tomoshibi light up the night in Japan!

The site was designed and coded by Daisuke Akatsuka of the Keio Kakehi Lab (xlab), the same fine folks who brought you interFORest.


  1. thecountdown-thumb.jpg 

Ten Grand Is Buried There

Wednesday, June 17th, 2009

By now many of you have probably seen this new Microsoft Australia campaign, “Ten Grand Is Buried Here.com,”1 which calls Firefox “old” and Safari “boring”:

microsoft.png

I’m not sure what this is saying about me, but my immediate reaction was to go check whether tengrandisburiedthere.com was available. To my surprise, Microsoft had yet to snatch it up! A few hours later, here’s the result:

tengrand-firefox.png

Go ahead, visit the site and give it a try!

Note: Not being a marketing guy, I just threw some text together to introduce Firefox. If someone has some better copy for this display, please let me know.


  1. As of this writing, this domain actually has yet to serve anything. 

Ubiquity in Firefox: Focus on Japanese

Friday, February 20th, 2009

One of the eventual goals of the Ubiquity project is to bring some of its functionality and ideas to Firefox proper. To this end, Aza has been exploring some possible options for what that would look like (round 1, round 2). All of his mockups, however, use English examples. I’m going to start exploring what Ubiquity in Firefox might look like in different kinds of languages. Let’s kick this off with my mother tongue, Japanese.1

今後多様な言語に対応したFirefox内のUbiquityを検討していきますが、その中でも今日は日本語をとりあげます。後日日本語で同じ内容を投稿するつもりです。^^ 日本語でのコメントも大歓迎です!

(more…)

selecting from Ubiquity

Wednesday, January 7th, 2009

I created a new Ubiquity command that gives you super fast access to your MySQL database’s data: select.


select Command for Ubiquity from mitcho on Vimeo.

Get the command and set it up here.