<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Traceback (most recent call last): &#187; Firefox</title>
	<atom:link href="http://www.mikealrogers.com/archives/category/firefox/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mikealrogers.com</link>
	<description></description>
	<pubDate>Wed, 07 Jan 2009 06:13:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>FireUnit first impressions</title>
		<link>http://www.mikealrogers.com/archives/327</link>
		<comments>http://www.mikealrogers.com/archives/327#comments</comments>
		<pubDate>Fri, 19 Dec 2008 00:37:06 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=327</guid>
		<description><![CDATA[<br/>It was pretty hard to get work done yesterday. My feed reader was filled with stories of how Apple is pulling out of Macworld and my IM and email were bursting with people asking me what I think about FireUnit.
I&#8217;m the co-author of two tools that overlap with FireUnit, Windmill and MozMill. I say overlap [...]]]></description>
			<content:encoded><![CDATA[<br/><p>It was pretty hard to get work done yesterday. My feed reader was filled with stories of how Apple is pulling out of Macworld and my IM and email were bursting with people asking me what I think about <a href="http://fireunit.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/fireunit.org');">FireUnit</a>.</p>
<p>I&#8217;m the co-author of two tools that overlap with FireUnit, <a href="http://www.getwindmill.com" onclick="javascript:pageTracker._trackPageview ('/outbound/www.getwindmill.com');">Windmill</a> and <a href="http://code.google.com/p/mozmill" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">MozMill</a>. I say overlap and not &#8220;compete&#8221; because I think the tools differ enough in their goals that they don&#8217;t directly compete.</p>
<p>FireUnit has some limitations. It&#8217;s an extension to Firebug which means it will only run on Firefox. It&#8217;s focused on providing a simple API for people who are competent JavaScript programmers. I think it&#8217;s safe to say that there is an emphasis on unittesting and not functional testing, and certainly an emphasis on testing content and not chrome.</p>
<p>Something really great happens when you create a tool that embraces limitations instead of trying to be too much to too many people. You tend to be able to create better smaller purpose tools for a selection of people that have been beating themselves up trying to make tools with less limitations work for a smaller use case.</p>
<h3>The API</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Simple true-like/false-like testing</span>
fireunit.<span style="color: #660066;">ok</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;I'm going to pass!&quot;</span> <span style="color: #009900;">&#41;</span>;
fireunit.<span style="color: #660066;">ok</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;I'm going to fail!&quot;</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #006600; font-style: italic;">// Compare two strings - shows a diff of the</span>
<span style="color: #006600; font-style: italic;">// results if they're different</span>
fireunit.<span style="color: #660066;">compare</span><span style="color: #009900;">&#40;</span>
  <span style="color: #3366CC;">&quot;The lazy fox jumped over the log.&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">&quot;The lazy brown fox jumped the log.&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">&quot;Are these two strings the same?&quot;</span>
<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #006600; font-style: italic;">// Compare a string using a regular expression</span>
fireunit.<span style="color: #660066;">reCompare</span><span style="color: #009900;">&#40;</span>
  <span style="color: #009966; font-style: italic;">/The .* fox jumped the log./</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">&quot;The lazy brown fox jumped the log.&quot;</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">&quot;Compare a string using a RegExp.&quot;</span>
<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #006600; font-style: italic;">// Display the total results</span>
fireunit.<span style="color: #660066;">testDone</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>This is the example from <a href="http://ejohn.org/blog/fireunit/" onclick="javascript:pageTracker._trackPageview ('/outbound/ejohn.org');">John Resig&#8217;s post about FireUnit</a>. I think it illustrates how awesome the API is. I&#8217;ve always been a huge fan of this &#8220;ok&#8221; style API instead of the larger jUnit style API <a href="http://code.google.com/p/mozmill/wiki/JavascriptUnittestModule" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">I keep being talked in to implementing</a>. Clearly FireUnit assumes it&#8217;s audience is JavaScript programmers that can write normal expressions to handle their pass/fail logic without the hand holding of a bigger API.</p>
<p>The beauty of the comparison API you really don&#8217;t appreciate until you look at the UI.</p>
<h3>Debugging</h3>
<p>I&#8217;m most critical of tools that don&#8217;t provide sufficient debugging tools. The test debugging environment is even more important than the test authoring environment in the long run.</p>
<p>There is no better tool for debugging the web than <a href="http://www.getfirebug.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.getfirebug.com');">Firebug</a>. A big part of Windmill&#8217;s debugging strategy is it&#8217;s integration of <a href="http://www.mikealrogers.com/archives/168">Firebug</a> and <a href="http://www.mikealrogers.com/archives/78">Firebug Lite</a> because there is just no better tool in the world. Firebug ROCKS!</p>
<p>FireUnit is built as an extension of Firebug, it&#8217;s integrated in a beautiful and intuitive way so they&#8217;ve totally dodged the need for any additional debugging work outside of creating a good UI for the test bits. I&#8217;m calling this out because I think as time goes on people aren&#8217;t going to talk about the debugging experience in FireUnit because they are so used to already using Firebug for debugging their regular development and won&#8217;t recognize how good they have it debugging their tests.</p>
<h3>The UI</h3>
<p>Another benefit of embracing limitations is that you trim down your feature set to only what is actually necessary. The upside to having a simple API is that you reduce the complexity of test data you need to represent in the UI. With all that going for it I expected the FireUnit UI to be pretty good but I was <strong>still</strong> blown away.<br />
<img src="http://fireunit.org/fireunit-1.png" alt="" /></p>
<p>Look at that comparison UI!</p>
<h3>The Bad</h3>
<p>Within the limitations described above FireUnit is great but as soon as you start to cross them you&#8217;ll be disappointed.</p>
<p>Although they have some helper APIs for doing some functional testing it&#8217;s not a good functional testing tool. The tests are async which is a real pain for functional testing which is incredibly synchronous. But I think if you want to do functional testing multiple browser support is a big concern and will already preclude you from using FireUnit.</p>
<p>Although you <em>can</em> test Chrome (Mozilla Chrome not Google Chrome) I wouldn&#8217;t venture outside of unittests. If you need to start getting at anonymous nodes and simulating events on them you&#8217;re gonna see your code get about 4 times larger than a typical mozmill test.</p>
<p>Right now there doesn&#8217;t seem to be a way to run FireUnit tests in continuous integration (tinderbox, buildbot, hudson, etc). But this could easily be overcome using <a href="http://code.google.com/p/jsbridge" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">jsbridge</a> and I&#8217;m happy to point the FireUnit guys in the right direction <img src='http://www.mikealrogers.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>At the end of the day I think there is a huge need for a tool like FireUnit that just does what it does well and doesn&#8217;t try to be too much to too many people. A tool like this is guaranteed to make it&#8217;s users very happy and I think those users are currently unhappy with the existing set of automation tools that are trying to fill a larger feature set.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/327/feed</wfw:commentRss>
		</item>
		<item>
		<title>MozMill HTTP Server API</title>
		<link>http://www.mikealrogers.com/archives/319</link>
		<comments>http://www.mikealrogers.com/archives/319#comments</comments>
		<pubDate>Thu, 18 Dec 2008 22:59:41 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=319</guid>
		<description><![CDATA[<br/>One of the big questions we&#8217;ve been getting since we outlined how to write unittests in mozmill is how to serve out local files over HTTP. For quite a while I&#8217;ve had a port of mochitest&#8217;s js http server in the mozmill source tree but hadn&#8217;t written a nice API for you to be able [...]]]></description>
			<content:encoded><![CDATA[<br/><p>One of the big questions we&#8217;ve been getting since we outlined how to write unittests in mozmill is how to serve out local files over HTTP. For quite a while I&#8217;ve had a port of mochitest&#8217;s js http server in the mozmill source tree but hadn&#8217;t written a nice API for you to be able to use it inside of your mozmill tests.</p>
<p>Ideally what I wanted was an API that worked a lot like how the dependencies work, which could serve out local files relative to the tests location on the filesystem. This way we don&#8217;t rely on any Python end to tell use what to serve out and can handle starting and stopping the server inside of the framework in the extension without any extra work from the test author. I finished the implementation a few weeks back but just <a href="http://code.google.com/p/mozmill/wiki/MozMillTestBasics#Serving_local_test_files" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">documented it today</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> mozmill <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>; 
Components.<span style="color: #660066;">utils</span>.<span style="color: #003366; font-weight: bold;">import</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resource://mozmill/modules/mozmill.js'</span><span style="color: #339933;">,</span> mozmill<span style="color: #009900;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> elementslib <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>; 
Components.<span style="color: #660066;">utils</span>.<span style="color: #003366; font-weight: bold;">import</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resource://mozmill/modules/elementslib.js'</span><span style="color: #339933;">,</span> elementslib<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> collector.<span style="color: #660066;">addHttpResource</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'./files'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> setupModule <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>module<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  module.<span style="color: #660066;">controller</span> <span style="color: #339933;">=</span> mozmill.<span style="color: #660066;">getBrowserController</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> testFoo <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  controller.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">+</span><span style="color: #3366CC;">'index.html'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This made it in before the last release so it&#8217;s available for use right away. Enjoy <img src='http://www.mikealrogers.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/319/feed</wfw:commentRss>
		</item>
		<item>
		<title>Processing a JSON stream</title>
		<link>http://www.mikealrogers.com/archives/291</link>
		<comments>http://www.mikealrogers.com/archives/291#comments</comments>
		<pubDate>Thu, 04 Dec 2008 02:40:14 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=291</guid>
		<description><![CDATA[<br/>In jsbridge we have a socket that stays open constantly and the JavaScript end streams JSON objects for all the events we care about in the browser back over to Python. In jsbridge this happens asynchronously and we use asyncore since it&#8217;s available in stdlib and is pretty lightweight, but the bulk of the parsing [...]]]></description>
			<content:encoded><![CDATA[<br/><p>In <a href="http://code.google.com/p/jsbridge/" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">jsbridge</a> we have a socket that stays open constantly and the JavaScript end streams JSON objects for all the events we care about in the browser back over to Python. In jsbridge this happens asynchronously and we use asyncore since it&#8217;s available in stdlib and is pretty lightweight, but the bulk of the parsing code is universal.</p>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> simplejson
decoder = simplejson.<span style="color: black;">JSONDecoder</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> StreamReader<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    sbuffer = <span style="color: #483d8b;">''</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> process_read<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, data<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;&quot;Parse out json objects and fire callbacks.&quot;&quot;&quot;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">sbuffer</span> += data
        <span style="color: #008000;">self</span>.<span style="color: black;">parsing</span> = <span style="color: #008000;">True</span>
        <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">self</span>.<span style="color: black;">parsing</span>:
            <span style="color: #808080; font-style: italic;"># Remove erroneus data in front of callback object</span>
            index = <span style="color: #008000;">self</span>.<span style="color: black;">sbuffer</span>.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'{'</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> index <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #ff7700;font-weight:bold;">not</span> -<span style="color: #ff4500;">1</span> <span style="color: #ff7700;font-weight:bold;">and</span> index <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #ff7700;font-weight:bold;">not</span> 0:
                <span style="color: #008000;">self</span>.<span style="color: black;">sbuffer</span> = <span style="color: #008000;">self</span>.<span style="color: black;">sbuffer</span><span style="color: black;">&#91;</span>index:<span style="color: black;">&#93;</span>
            <span style="color: #808080; font-style: italic;"># Try to get a json object from the data stream</span>
            <span style="color: #ff7700;font-weight:bold;">try</span>:
                obj, index = decoder.<span style="color: black;">raw_decode</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">sbuffer</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>, e:
                <span style="color: #008000;">self</span>.<span style="color: black;">parsing</span> = <span style="color: #008000;">False</span>
            <span style="color: #808080; font-style: italic;"># If we got an object fire the callback infra</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">parsing</span>:
                <span style="color: #008000;">self</span>.<span style="color: black;">fire_callbacks</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span>
                <span style="color: #008000;">self</span>.<span style="color: black;">sbuffer</span> = <span style="color: #008000;">self</span>.<span style="color: black;">sbuffer</span><span style="color: black;">&#91;</span>index:<span style="color: black;">&#93;</span></pre></div></div>

<p>The process_read function gets called every time a block of data gets read from the stream so it needs to be able to handle multiple JSON objects in a single read, objects that span multiple reads, and junk (usually spaces and return carriers) showing up between JSON objects.</p>
<p>If you wanna see this code in the wild you can check out the <a href="http://code.google.com/p/jsbridge/source/browse/trunk/jsbridge/network.py#205" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">jsbridge source</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/291/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using the mozmill menu API</title>
		<link>http://www.mikealrogers.com/archives/262</link>
		<comments>http://www.mikealrogers.com/archives/262#comments</comments>
		<pubDate>Wed, 03 Dec 2008 03:25:16 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=262</guid>
		<description><![CDATA[<br/>One of the first pieces of feedback we got on MozMill was that there didn&#8217;t seem to be any way to click on system menus.
System menus are defined in XUL using a special set of elements. Those are then displayed differently on every operating system and as such we can&#8217;t use tools like the MozMill [...]]]></description>
			<content:encoded><![CDATA[<br/><p>One of the first pieces of feedback we got on MozMill was that there didn&#8217;t seem to be any way to click on system menus.</p>
<p>System menus are defined in XUL using a <a href="https://developer.mozilla.org/en/XUL/menu" onclick="javascript:pageTracker._trackPageview ('/outbound/developer.mozilla.org');">special set of elements</a>. Those are then displayed differently on every operating system and as such we can&#8217;t use tools like the MozMill Inspector to get repeatable elements to click on.</p>
<p>After digging in to this problem a bit I figured out that the elements defining menus can be traversed and that they even respond properly to .click(). I then wrote thin API around the elements so that they can be easily looked up by name the way they are displayed in the menus. You can see the full documentation <a href="http://code.google.com/p/mozmill/wiki/MenuAPI" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">here</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> mozmill <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>; 
Components.<span style="color: #660066;">utils</span>.<span style="color: #003366; font-weight: bold;">import</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resource://mozmill/modules/mozmill.js'</span><span style="color: #339933;">,</span> mozmill<span style="color: #009900;">&#41;</span>;
<span style="color: #003366; font-weight: bold;">var</span> elementslib <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>; 
Components.<span style="color: #660066;">utils</span>.<span style="color: #003366; font-weight: bold;">import</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resource://mozmill/modules/elementslib.js'</span><span style="color: #339933;">,</span> elementslib<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> setupModule <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>module<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  module.<span style="color: #660066;">controller</span> <span style="color: #339933;">=</span> mozmill.<span style="color: #660066;">getBrowserController</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> testMenu <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// Example 1: Click menus without testing the click</span>
  controller.<span style="color: #660066;">menus</span>.<span style="color: #660066;">File</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;New Tab&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
  controller.<span style="color: #660066;">menus</span>.<span style="color: #660066;">View</span>.<span style="color: #660066;">Sidebar</span>.<span style="color: #660066;">Bookmarks</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
  controller.<span style="color: #660066;">menus</span>.<span style="color: #660066;">View</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;Page Style&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;No Style&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
  <span style="color: #006600; font-style: italic;">// Example 2: Click menus and test the click</span>
  controller.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> elementslib.<span style="color: #660066;">Elem</span><span style="color: #009900;">&#40;</span>controller.<span style="color: #660066;">menus</span>.<span style="color: #660066;">File</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;New Tab&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
  controller.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> elementslib.<span style="color: #660066;">Elem</span><span style="color: #009900;">&#40;</span>controller.<span style="color: #660066;">menus</span>.<span style="color: #660066;">View</span>.<span style="color: #660066;">Sidebar</span>.<span style="color: #660066;">Bookmarks</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
  controller.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> elementslib.<span style="color: #660066;">Elem</span><span style="color: #009900;">&#40;</span>controller.<span style="color: #660066;">menus</span>.<span style="color: #660066;">View</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;Page Style&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;No Style&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see the API is a simple chain of objects by name cascading down the different sub menus until a menu element is reached. Attribute access is just plain old JavaScript so you only need to use ["name"] syntax when looking up menus with names that contain spaces. The API is most definitely case sensitive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/262/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using mozmill for unittests</title>
		<link>http://www.mikealrogers.com/archives/252</link>
		<comments>http://www.mikealrogers.com/archives/252#comments</comments>
		<pubDate>Wed, 03 Dec 2008 01:16:27 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=252</guid>
		<description><![CDATA[<br/>MozMill already has some big advantages over mochitest. For one, you don&#8217;t need a special test build, you can write and run tests against any build of a Mozilla Application. You can even write and run tests just using the extension and not worry about any Python stuff until you set it up in continuous [...]]]></description>
			<content:encoded><![CDATA[<br/><p>MozMill already has some big advantages over mochitest. For one, you don&#8217;t need a special test build, you can write and run tests against any build of a Mozilla Application. You can even write and run tests just using the extension and not worry about any Python stuff until you set it up in continuous integration.</p>
<p>MozMill already runs in &#8220;chrome&#8221;, or what Adam and I have been referring to as the &#8220;trusted&#8221; environment. All the tests that get run in MozMill are imported in this environment, which means you have access to pretty much everything in the Mozilla environment. We also have a <a href="http://code.google.com/p/mozmill/wiki/MozMillTestBasics" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">dependency system and a setup/teardown system for tests</a>.</p>
<p>All we were missing was a simple unittest API that can trigger failures without causing exceptions like the MozMill functional testing APIs. I looked at what others have done including <a href="http://dojotoolkit.org/book/dojo-book-0-9/part-4-meta-dojo/d-o-h-unit-testing" onclick="javascript:pageTracker._trackPageview ('/outbound/dojotoolkit.org');">dojo</a>, <a href="http://mochikit.com/tests/index.html" onclick="javascript:pageTracker._trackPageview ('/outbound/mochikit.com');">mochikit</a>, and <a href="http://www.jsunit.net/documentation/assertions.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.jsunit.net');">jsunit</a>. </p>
<p>Fortunately MozMill gets out of any test registration and staggering stuff, it already has a well defined way of defining tests and dependencies and a clear way to run tests for debugging and continuous integration. Of all the different jum (JavaScript Unittest Module) APIs I liked jsunit the most except for the incredibly stupid idea of passing the comment argument first instead of making it an optional last argument.</p>
<p>In the end MozMill got it&#8217;s own jum which I&#8217;ve just <a href="http://code.google.com/p/mozmill/wiki/JavascriptUnittestModule" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">finished up documenting</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> jum <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>; Components.<span style="color: #660066;">utils</span>.<span style="color: #003366; font-weight: bold;">import</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resource://mozmill/modules/jum.js'</span><span style="color: #339933;">,</span> jum<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> testAsserts <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  jum.<span style="color: #660066;">assert</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertTrue</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertFalse</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertEquals</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asdf'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'asdf'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotEquals</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asdf'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'fdsa'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNull</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotNull</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertUndefined</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>.<span style="color: #660066;">asdf</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotUndefined</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asdf'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNaN</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotNaN</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">pass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> testNotAsserts <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// All of these calls should fail</span>
  jum.<span style="color: #660066;">assert</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertTrue</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertTrue</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asf'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertFalse</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertFalse</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asdf'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertEquals</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asdf'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'fdsa'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotEquals</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asdf'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'asdf'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNull</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotNull</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertUndefined</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'asdf'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotUndefined</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>.<span style="color: #660066;">asdf</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNaN</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">assertNotNaN</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'f'</span><span style="color: #009900;">&#41;</span>;
  jum.<span style="color: #660066;">fail</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>All of these functions take an optional comment argument which can be any JSON serializable value (string, int, obj, array, null, bool).</p>
<p>What we&#8217;re missing right now is the http local file server. I&#8217;ve already ported mochikit&#8217;s web server to be a resource but I&#8217;m still working on a better API for using it. What we want is for tests to simply define local relative paths that should be mounted at different local url namespaces and the framework can handle starting and stopping the server if necessary. This API will be finished in the next few weeks and ready for MozMill 1.0 (which we&#8217;re looking at pushing out before January 1st).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/252/feed</wfw:commentRss>
		</item>
		<item>
		<title>MozMill 1.0RC2 w/ Test Recorder</title>
		<link>http://www.mikealrogers.com/archives/248</link>
		<comments>http://www.mikealrogers.com/archives/248#comments</comments>
		<pubDate>Sun, 30 Nov 2008 00:24:51 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=248</guid>
		<description><![CDATA[<br/>Last week we finished up the 1.0RC2 release of MozMill.
The biggest new feature was is the Test Recorder. You can now hit the Record button and use the Application normally and create a test outline. I say &#8220;test outline&#8221; because it&#8217;s usually necessary after creating a recorded test to go in and fill it up [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Last week we finished up the <a href="https://addons.mozilla.org/en-US/firefox/addon/9018" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">1.0RC2</a> release of <a href="http://code.google.com/p/mozmill/" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">MozMill</a>.</p>
<p>The biggest new feature was is the Test Recorder. You can now hit the Record button and use the Application normally and create a test outline. I say &#8220;test outline&#8221; because it&#8217;s usually necessary after creating a recorded test to go in and fill it up with a few conditional wait calls, like waitForElement and waitForPageLoad. If you don&#8217;t the test runs too fast and ends up failing pretty quickly. We&#8217;re working on some future code to pick up things like new page loads so that we can add those waits in a recorded test but for now you&#8217;ll have to do them by hand.</p>
<p>We also have significantly improved some of the documentation.</p>
<ul>
<li><a href="http://code.google.com/p/mozmill/wiki/MozMillTestBasics" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">http://code.google.com/p/mozmill/wiki/MozMillTestBasics</a></li>
<li><a href="http://code.google.com/p/mozmill/wiki/CommandLine" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">http://code.google.com/p/mozmill/wiki/CommandLine</a></li>
<li><a href="http://code.google.com/p/mozmill/wiki/MenuAPI" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">http://code.google.com/p/mozmill/wiki/MenuAPI</a></li>
</ul>
<p>I&#8217;ll be writing some more blog entries this week on using MozMill for writing and running different kinds of tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/248/feed</wfw:commentRss>
		</item>
		<item>
		<title>Introducing&#8230; jsbridge</title>
		<link>http://www.mikealrogers.com/archives/210</link>
		<comments>http://www.mikealrogers.com/archives/210#comments</comments>
		<pubDate>Tue, 28 Oct 2008 07:10:37 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=210</guid>
		<description><![CDATA[<br/>I started working on this library months ago and it&#8217;s been getting some use already. I spoke about it a bit at Mozilla Summit and as a result there was a post on Ajaxian, but for the most part I&#8217;ve been holding off on promoting it until I solidified the API and pushed out a [...]]]></description>
			<content:encoded><![CDATA[<br/><p>I started working on this library months ago and it&#8217;s been getting some use already. I spoke about it a bit at Mozilla Summit and as a result there was a post on <a href="http://ajaxian.com/archives/jsbridge-powering-mozilla-with-python" onclick="javascript:pageTracker._trackPageview ('/outbound/ajaxian.com');">Ajaxian</a>, but for the most part I&#8217;ve been holding off on promoting it until I solidified the API and pushed out a solid release.</p>
<p><a href="http://code.google.com/p/jsbridge" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">jsbridge</a> is a Python to JavaScript translation interface for Mozilla applications. It&#8217;s implemented as an extension and can be dynamically installed and launched in a new &#8220;clean&#8221; profile using <a href="http://code.google.com/p/mozrunner" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">mozrunner</a>.</p>
<p>You can call functions and set variables in any window in any scope from Python and those objects are returned and represented as Python objects (which are just classes that inherit from Python base types). There are obvious limitations for assignment and representations in Python, you can really only send objects over the bridge that can be JSON serialized, but it does support assignments by reference so you can move around and manipulate anything that&#8217;s already there.</p>
<p>But the most interesting feature is the event system. The event system is available as a resource from inside the Mozilla environment (in other words you can import it from your Firefox extension). Events fired on the JavaScript end are serialized as JSON and sent to the Python side. This means you can add listeners in Python to events fired from the Mozilla JavaScript environment.</p>
<p>This is a big deal. It means we can write significantly cleaner tools. We can now create tools solely as Firefox extensions that don&#8217;t require any special Python code to run, but have code that checks if jsbridge is installed and send pertinent events over the bridge for continuous integration. No more printing to console and parsing in Python, no more outputting to log files and parsing them, no more scripts calling scripts and OH MAN MY HEAD HURTS!</p>
<p>The documentation has some great <a href="http://code.google.com/p/jsbridge/wiki/UsingJSBridge#JavaScript_(most_likely_to_be_placed_in_your_extension_code)" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">examples</a>.</p>
<p>For a little snippet of the events system in the wild here is some new <a href="http://code.google.com/p/mozmill" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">mozmill</a> Python code that sends all the events to the Python logger.</p>

<div class="wp_syntax"><div class="code"><pre class="python python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">logging</span>
logger = <span style="color: #dc143c;">logging</span>.<span style="color: black;">getLogger</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;mozmill&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> jsbridge <span style="color: #ff7700;font-weight:bold;">import</span> events
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> LoggerListener<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    cases = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'mozmill.pass'</span>:   <span style="color: #ff7700;font-weight:bold;">lambda</span> obj: logger.<span style="color: black;">debug</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Test Pass: '</span>+<span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
        <span style="color: #483d8b;">'mozmill.fail'</span>:   <span style="color: #ff7700;font-weight:bold;">lambda</span> obj: logger.<span style="color: black;">error</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Test Failure: '</span>+<span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
    <span style="color: black;">&#125;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">class</span> default<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, eName<span style="color: black;">&#41;</span>: <span style="color: #008000;">self</span>.<span style="color: black;">eName</span> = eName
        <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__call__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, obj<span style="color: black;">&#41;</span>: logger.<span style="color: black;">info</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">eName</span>+<span style="color: #483d8b;">' :: '</span>+<span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__call__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, eName, obj<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">cases</span>.<span style="color: black;">has_key</span><span style="color: black;">&#40;</span>eName<span style="color: black;">&#41;</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">cases</span><span style="color: black;">&#91;</span>eName<span style="color: black;">&#93;</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">cases</span><span style="color: black;">&#91;</span>eName<span style="color: black;">&#93;</span> = <span style="color: #008000;">self</span>.<span style="color: black;">default</span><span style="color: black;">&#40;</span>eName<span style="color: black;">&#41;</span>
            <span style="color: #008000;">self</span>.<span style="color: black;">cases</span><span style="color: black;">&#91;</span>eName<span style="color: black;">&#93;</span><span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span>
&nbsp;
events.<span style="color: black;">add_global_listener</span><span style="color: black;">&#40;</span>LoggerListener<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">logging</span>.<span style="color: black;">basicConfig</span><span style="color: black;">&#40;</span>level=<span style="color: #dc143c;">logging</span>.<span style="color: black;">ERROR</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/210/feed</wfw:commentRss>
		</item>
		<item>
		<title>Ubiquity command for docs.python.org</title>
		<link>http://www.mikealrogers.com/archives/196</link>
		<comments>http://www.mikealrogers.com/archives/196#comments</comments>
		<pubDate>Fri, 24 Oct 2008 01:01:34 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mozilla]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=196</guid>
		<description><![CDATA[<br/>
Ubiquity rocks! A month or so ago I completely removed the search box from Firefox and started solely using ubiquity for searches.
The one thing that I really missed was a python doc search that I used to have for the search box. For a while I just used the awesome bar to perform google and [...]]]></description>
			<content:encoded><![CDATA[<br/><link rel="commands" href="http://www.mikealrogers.com/wp-content/uploads/python-ubiquity.js" name="Python Ubiquity Command" />
<p>Ubiquity rocks! A month or so ago I completely removed the search box from Firefox and started solely using ubiquity for searches.</p>
<p>The one thing that I really missed was a python doc search that I used to have for the search box. For a while I just used the awesome bar to perform google and history searches for python docs but that basically broke when Python 2.6 was released since all the old docs.python.org urls that google returns break because 2.6 has completely new docs provided by <a href="http://sphinx.pocoo.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/sphinx.pocoo.org');">Sphinx</a>.</p>
<p>So today I took a break from my &#8220;normal&#8221; work to write a ubiquity command to bring up the search page from docs.python.org for your input text. You can see the source <a href="http://www.mikealrogers.com/wp-content/uploads/python-ubiquity.js" title="python ubiquity command">here</a> and you should be able to install it by viewing this <a href="http://www.mikealrogers.com/archives/196">blog post</a>.</p>
<p>In the future I&#8217;d like to do better previews of the searches but I can&#8217;t seem to find any web API for searching docs.python.org.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/196/feed</wfw:commentRss>
		</item>
		<item>
		<title>MozMill Beta2 Released</title>
		<link>http://www.mikealrogers.com/archives/183</link>
		<comments>http://www.mikealrogers.com/archives/183#comments</comments>
		<pubDate>Mon, 13 Oct 2008 19:52:35 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=183</guid>
		<description><![CDATA[<br/>Last week we finished up the Beta2 Release for MozMill.
You can install it from AMO.
We&#8217;ve been gathering feedback from our Beta1 release and pushed out another incremental beta release before the big push for MozMill 1.0 RC1.
One important thing we did was improve the inspector workflow. It&#8217;s much smother clicking on an element and coming [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Last week we finished up the Beta2 Release for MozMill.</p>
<p>You can <a href="https://addons.mozilla.org/en-US/firefox/addon/9018" onclick="javascript:pageTracker._trackPageview ('/outbound/addons.mozilla.org');">install it from AMO</a>.</p>
<p>We&#8217;ve been gathering feedback from our Beta1 release and pushed out another incremental beta release before the big push for MozMill 1.0 RC1.</p>
<p>One important thing we did was improve the inspector workflow. It&#8217;s much smother clicking on an element and coming back to the Inspector. The inspector also gives you much more information now, including what document you should be passing the Elem you create and what method you should use to create a controller for the window you&#8217;re testing.</p>
<p><a href="http://www.mikealrogers.com/wp-content/uploads/2008/10/mozmill.png"><img class="alignnone size-full wp-image-185" title="MozMill Beta2 Inspector" src="http://www.mikealrogers.com/wp-content/uploads/2008/10/mozmill.png" alt="" width="530" height="655" /></a></p>
<p>Lot&#8217;s of bug fixes, special thanks to Tony, Tracy and a big hug to Farhad for feature suggestions and filing bugs against beta1.</p>
<p>This release does not include the new framework that hooks up to <a href="http://code.google.com/p/jsbridge" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">jsbridge</a>, and therefor isn&#8217;t ready for full continuous integration, that&#8217;s now in trunk getting worked on for the RC1 release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/183/feed</wfw:commentRss>
		</item>
		<item>
		<title>Windmill 0.9.1 Released</title>
		<link>http://www.mikealrogers.com/archives/168</link>
		<comments>http://www.mikealrogers.com/archives/168#comments</comments>
		<pubDate>Mon, 13 Oct 2008 17:51:27 +0000</pubDate>
		<dc:creator>mikeal</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[Windmill]]></category>

		<guid isPermaLink="false">http://www.mikealrogers.com/?p=168</guid>
		<description><![CDATA[<br/>I didn&#8217;t think we&#8217;d be doing any notable windmill releases until 1.0. Boy was I wrong!
Seriously Faster
On Wednesday Adam messaged me and said that the windmill startup time was too slow. He was right, we&#8217;ve know about this for a while but hadn&#8217;t put a lot of serious thought in to how we could reduce [...]]]></description>
			<content:encoded><![CDATA[<br/><p>I didn&#8217;t think we&#8217;d be doing any notable windmill releases until 1.0. Boy was I wrong!</p>
<h4>Seriously Faster</h4>
<p>On Wednesday Adam messaged me and said that the windmill startup time was too slow. He was right, we&#8217;ve know about this for a while but hadn&#8217;t put a lot of serious thought in to how we could reduce it.<br />
The issue here was was that we have about 50 JavaScript files that need to get loaded for windmill to start.</p>
<p>Enter windmill-compressor, a new url namespace we added that concats all the js windmill needs in to one file and minifies it. We do this dynamically when windmill starts up, because adding a &#8220;build&#8221; step would just be too&#8230;.. Java.</p>
<p>That reduced the startup time from 5-10 seconds to around 2 seconds. But that wasn&#8217;t good enough. We saw that most of that startup time was blocking waiting for the compressor to finish, so I threaded it when we start the windmill service and it does the compression while we wait for the browser to start up.</p>
<p>In all, windmill startup times are about 10x faster than 0.9!</p>
<p>Adam also decided to make our page load wait code a bit more aggressive which made not only startup times faster but all of our tests!</p>
<h4>Native JavaScript Test Framework</h4>
<p>We tied up the loose ends on the JavaScript testing framework and it can now shutdown all of windmill in it&#8217;s own teardown, hello continuous integration for native JavaScript tests <img src='http://www.mikealrogers.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This was the last thing holding us back from promoting this along side the Python test authoring library.</p>
<h4>We Love Firebug</h4>
<p>In 0.9 we introduced Firebug Lite integration for windmill on all browsers. But when you&#8217;re using Firefox you probably still want to use the full Firebug extension, which is easy enough to integrate since we use <a href="http://code.google.com/p/mozrunner" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">mozrunner</a> for Firefox launching.</p>
<p>Windmill now has a &#8220;firebug&#8221; command line argument that installs the full Firebug<br />
extension when launching Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikealrogers.com/archives/168/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
