News for the ‘Open Source’ Category

Dabbling in Cocoa/iPhone SDK

As I gear towards graduation at Seneca College, I am actively engaged in an a professional Apple Development course. Why am I enrolled? Merely an interest for learning different languages; discovering their quirks, oddities and normalities. As well, I am using this astute scenario to experience the procedures and protocol in developing software on a mobile device. Nonetheless, the course should be fun and a unique learning opportunity.

As part of my first lab, we were to get a feel for the different interface builder UI objects within a single view in order to create a manipulating student profile. See below.

Posted: January 27th, 2010
Categories: Miscellaneous, Open Source
Tags:
Comments: 1 Comment.

HTML5 Canvas/getImageData and the nefarious

This afternoon, I indulged myself by returning to my HTML5 experimentation and tinkering, toying with the canvas element by testing the waters of different functions under the HTML5 specification API.

All was good until I got to getImageData(), where I encountered an exception in console. The crux is this: I’m getting an NS_ERROR_DOM_SECURITY_ERR error when trying to run context.getImageData()

A bit about getImageData():

To obtain an ImageData object containing a copy of the pixel data for a context, you can use the getImageData() method:

var myImageData = context.getImageData(left, top, width, height);

Ultimately, I wanted to use this function to place a image on canvas and perform some direct pixel manipulation; perhaps inverse an image by first getting the image data from a context.

window.addEventListener('load', function () {
  var canvas = document.getElementById("canvas");
  var ctx = canvas.getContext("2d");
  var img = new Image();

  img.addEventListener('load', function () {
    var x = 0,
      y = 0;

    ctx.drawImage(this, x, y);

    var imgd = ctx.getImageData(x, y, this.width, this.height);
    var imxpxl = imgd.data;

    for (var i = 0, n = imxpxl.length; i < n; i += 4) {
      imxpxl[i] = 255 - imxpxl[i]; // red
      imxpxl[i + 1] = 255 - imxpxl[i + 1] // green;
      imxpxl[i + 2] = 255 - imxpxl[i + 2] // blue;
      // i+3 is alpha
    }
    ctx.putImageData(imgd, x, y);
  },
  false);
  img.src = "http://www.google.ca/intl/en_ca/images/logo.gif";
},
false);

Running this code, I didn't get the results I expected. In fact, I did not think out of the ordinary was incorrect, until I checked the error console and found:

Error: uncaught exception: [Exception... "Security error"  code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "file:///pixeldata.html Line: 16"]

Interesting - why the need to raise privileges? Am I forgetting something here? If I toss a,

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");

I end up with something yucky like this

try {
  try {
    imgd = ctx.getImageData(x, y, this.width, this.height);
  } catch(e) {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
    imgd = ctx.getImageData(x, y, this.width, this.height);
  }
} catch(e) {
  throw new Error("unable to access image data: " + e);
}

but, running the code will yield:

A script from "file://" is requesting enhanced abilities that are UNSAFE and could be used to compromise your machine or data:

In this case, the code will run - but it will leave you with an impression that what you're doing is wrong.

I'm not nefarious, I swear! No intent to do harm here. I am trying to understand the reasoning and or need for raised privileges just to extract data from a context. With a write to canvas, a nefarious user could write something nasty to context, but why with getImageData?

- Aaron

Posted: December 18th, 2009
Categories: Open Source
Tags:
Comments: 9 Comments.

‘Stymied From Experimentation’ – Firefox ‘View Page Source’

Firefox’s – ‘View Source’ component sucks. It must improve.

Upon reading the WebMonkey article, “After Five Years on the Web Firefox Preps for the Next Round“, I was reminded of a suppressed annoyance, or ‘beef’ I have with Firefox through reading Jonathan Nightengale’s statement.

When a developer loses the ability to view a web page’s source code (something you can’t easily do in Flash) they can’t see how web applications and complex interactions function. And, he says, that stymies further experimentation”

Jonathan is absolutely correct. Developers need the ability to learn from each other and the only best way to do this is through viewing a web page’s source code. View Page Source is a door to undiscovered knowledge on the web.

Ah yes, ‘View Page Source’.

See, in order to boast and fully support this idea, I believe that developers need to have access to the best tools available. Developers need to harness these tools and utilize them to their fullest potential. These tools should exhibit engaging yet intuitive functionality and rewarding characteristics.

See, my ‘beef’ is with Firefox’s ‘View Page Source’. It sucks. It’s really bad. It’s archaic. In-fact, here are 200 bugs spanning multiple years pertaining to the simple view-source component in Firefox.

Here’s my personal listing of ideas to improve View Source with 5 improvements:

  1. Introduce proper syntax highlighting (crucially needed with the new HTML5 parser)
  2. Links should have copy link location in the context menu
  3. Line numbers should appear in a side column
  4. Add view-selection-source ability
  5. Interface should be tabbed!

With many of those 200 (simple query search of ‘View Source’) filed as enhancements, it’s clear that the view-source component needs a complete overhaul.

ucGdf

I believe that Firefox needs to revamp it’s view-source component in order to supply developers with the best tools necessary to prevent a case of being stymied from experimentation and any other further barriers of innovation on the web.

Developers need the best tools out there, and I feel that they are left out of what could be an awesomely improved component and uniquely defined characteristic of the entire Firefox experience.

Currently, I dont think there is a significant drive towards prioritizing this component in the browser. In fact, I dont think it has been touched in many years. It certainly feels archaic, sluggish and lacking. Has the code been touched in years?

So I ask the community, you reading this, do you wish to collaborate to revitalize this dying dead horse?

What do you think?

Posted: November 7th, 2009
Categories: Open Source
Tags:
Comments: 1 Comment.

FSOSS 2009 – So many choices

Toronto Open Source Week

As part of Toronto Open Source Week, tomorrow marks the start of the 8th annual Free Software and Open Source Symposium at Seneca College

FSOSS 2009

With a vast range of academically intriguing presentations and focused based hands-on workshops to choose from, I have narrowed down a listing of presentations that I will attend to.

Thursday
09:00 AM Automating UI Testing with Mozmill
Friday
10:00 AM Ranking the Bugs: Predicting Which Bugs Will Get Fixed
11:00 AM Open Source Licensing Demystified
1:00 PM Coping at the Scale of Mozilla: How Mozilla uses Open Tools to Manage Complexity
2:00 PM Open Source for fun and profit: making a career out of FOSS
3:00 PM 3D in the browser… more than just Doom

Bring on tomorrow – I hope to see you all there :)

Posted: October 28th, 2009
Categories: Open Source
Tags:
Comments: No Comments.

Toronto Open Source Week 2009

Toronto Open Source Week 2009

October 24-30, 2009

Toronto Open Source Week is a celebration of Open Source technology and community throughout the Toronto area. The following events have been confirmed; additional events are being planned.

Saturday, October 24 Ontario Linux Fest
Monday, October 26 Open Source Showcase for Non-Profits
Tuesday, October 27 FOSSLC – Web programming bootcamp
Thursday, October 29 Free Software and Open Source Symposium – Workshops
Teaching Open Source Summit
Friday, October 30 Free Software and Open Source Symposium – Presentations
Posted: October 1st, 2009
Categories: Open Source
Tags:
Comments: No Comments.

Wrapping Up an Internship at Mozilla

Friday is approaching fast, it will be my last official day as an intern with Mozilla Corporation, but certainly not my last day with the project and overall initiative.

The past four month’s have offered me an an incredible chance to learn, far more than any one job, classroom or book may offer. I have learned a lot; everything from the Mozilla platform to invalidation reference testing to XML User Interface Language (XUL) to reducing test-cases for crashes in the browser to even the vast assortment of brown-bag and meet-up discussions, I have learned a lot. With the knowledge gained, this internship opportunity has been far more rewarding than one could possibly imagine. There is nothing more rewarding than having the opportunity to discover and ascertain and to certainly ask many upon many questions.

Four month’s long, I worked alongside the QA (Execution & Test Dev), (that of which include Clint and Heather) team driving forth many efforts within the world of testing. Over the months, I got to tackle quite a few tricky issues that turned out to require new and unique solutions that I really enjoyed inventing and implementing. The different challenges and testing opportunities were each rewarding as they demonstrated the underlying importance of software testing.

See my parting presentation here for a complete overview (no <iframe/> in WordPress) of the major project I worked on in July/August and the test development areas I worked on in May and June .

http://mozillalinks.org/wp/wp-content/uploads/2008/01/mozilla_logo.png

That being said, I’m not gone yet. Despite a return to my final year of software development in school, I’ll continue to chip in to the efforts of the QA team and other projects to come, only I’ll be on IRC at a slightly different time of day.

Thanks Mozilla and in particular the friendly folks of QA for the first-rate experience!

Take care Mozilla,

Aaron

Posted: August 25th, 2009
Categories: Mozilla Internship, Open Source
Tags:
Comments: No Comments.

Totally hip, totally rad Mozilla QA Companion 1.0

Mozilla QA Companion 1.0 Released

Fresh new QA Companion. This version has a revamped design of the former QAC, with functionality for running manual tests, reporting bugs, and viewing the latest QMO news. 1.0 is a vast improvement over 0.2.3!

Download the latest version here

So what is the Mozilla QA Companion (QAC)?

The Mozilla QA Companion (QAC) is a new tool that was created after discussions between the QA team and community about how to make it easier for anyone to get involved with the Mozilla project and help us test Firefox.

The QAC is meant to be an easy way to get community members involved in the QA process. It pulls testcases from Litmus and provides a response form, all within the QAC interface. The QAC also includes notifications for important QA events such as Bug Days, and keeps users up-to-date with live feeds from the QMO site and forums.

Features

  • General QMO tab — updates on news, forums, etc.
  • ‘Run Tests’ tab — This is the heart of the extension. It allows users to get testcases to run and to submit results from within the extension. QAC will detect most system settings and helps new users set up a Litmus account if they don’t have one already.
  • ‘File Bug’ tab – File bugs by submitting a report!
  • Settings/Help (Preferences) — This is for the confused or misconfigured.

Installation

You can install the QA Companion like any other Firefox add-on by visiting https://addons.mozilla.org/en-US/firefox/addon/5428

Getting involved with testing and development

The interface is fairly intuitive and easy to follow, but please let us know if you have any questions. Find us on IRC or post to the QMO forums. We hope you find the Mozilla QA Companion a useful tool that helps you get more involved with the Mozilla QA community!

Thanks!

- Aaron Train, on behalf of the Mozilla QA Companion revamp team

Posted: August 8th, 2009
Categories: Mozilla Internship, Open Source
Tags:
Comments: No Comments.

The Beauty of the Community

It was only about 12 days ago that we released Firefox 3.5 and unveiled one of the new core features; support for the HTML5 <video> and <audio> elements including native support for Ogg Theora encoded video and Vorbis encoded audio. Less than 12 days later, community members have created basic full screen support for the video element; an enhancement feature in design phase on Bugzilla!

That’s incredible!

Full Screen Video, is the name of the add-on, and it adds a Full Screen option to the context menu for HTML5 videos.

Cheers, ‘design-noir’

Aaron

Posted: July 12th, 2009
Categories: Open Source
Tags:
Comments: 5 Comments.

A Week of Milestones

In the spirit of an exciting successful week, I would like to congratulate our friends at SourceForge who have delivered their 4,000,000,000th open source download. That’s one of a few major open source milestones this week. That’s a lot of downloads.

Posted: July 2nd, 2009
Categories: Open Source
Tags:
Comments: 1 Comment.

Mozilla and the Future of the Internet

Having just watched Yann Arthus-Bertrand’s hymn for the planet, titled HOME – an ode to the planet’s beauty and its delicate harmony, it triggered some thinking on what’s going on in the world.

HOME is more than a documentary with a message, it is a magnificent movie in its own right and has an impact on anyone who sees it. It awakens in us the awareness that is needed to change the way we see the world. It embraces the major ecological issues that confront us and shows how everything on our planet is interconnected. Everything is interconnected.

How can we take this means of awakening, interconnection and global consanguinity to bring everyone together on the web? Can we accelerate an integrated worldview towards critical mass by opening a medium where people can see what happens when they are empowered by each other?

We all want to live in a better world, and many among us are working to make that world a possibility. Improvement is achieved through ideation, innovation, cultivation and application of solutions to problems. However, due to the blindingly complex nature of the problems we currently face, equally sophisticated solutions are required. These solutions are beyond the realm of any one person or small group of people. It is the globe that faces these problems and thus it is the global mind that must develop matching solutions.

There are now more links, websites, documents and files on the internet than there are synapses in a single human brain. Having reached into every attribute of human life, it is now steering the course of history.

It is estimated that over 1.5 billion individuals have access to the internet with user growth ever increasing in the developing world. Classified as the most capable and sophisticated tool ever developed by mankind, the internet represents the pinnacle of thousands of years of technological development.

Accelerating at rapid growth at blazing speeds in development, it affirms rather than conflicts with human identify. In essence, it connects us in real and personal ways to other human beings. With higher potential beginning to reveal itself, an opportunity is presented to forge a network which interconnects those who improve our world. We now have the means and the wisdom to implement a system that fosters world-changing collaboration amongst the people of this planet.

We are, without question, living in the most exciting time in human history. Human potential is expanding as technology continues to bring awareness to the great realm of our knowledge and understanding, the populace of our planet are beginning to awaken, en masse, to our true inner nature and our integrated relationship with the world around us.

As the world wakens to its indissoluble oneness, we still see an escalating disarray. Fears of governmental paranoia and terrorism run amok, global economic collapse looms, and of course the earth herself is exhibiting the symptoms of feeble health.

We are now at a crossroads. Despite all the incalculable knowledge available at our fingertips, we are unable to predict the days forthcoming. There comes a point when every new and competing idea is put to a test. If that idea is to be successful it must reach a critical mass.

How can Mozilla and the internet of tomorrow work to accelerate an integrated worldview towards critical mass by opening a medium where people can see what happens when they are empowered by each other?

- AaronMT

Posted: June 28th, 2009
Categories: Human Factors, Mozilla Internship, Open Source
Tags:
Comments: No Comments.

The Open Web with HTML5 Video & Firefox 3.5

Each day, it is becoming more and more evident that the Open Web and the technology of tomorrow is expanding and blossoming into beautifully crafted future Internet.

As Firefox 3.5 is rounding the track towards the finish line, I can’t help but put my personal focus on that of HTML5 video. Firefox’s implementation of the HTML5 video API accompanied with royalty-free codecs, fundamentally progress the movement towards bringing an open video to the web.

HTML5 video truly is fascinating stuff, as Mike Beltzner explains, gone are the days of static videos played on static pages. With HTML5 video, we can treat video’s  like web pages – which makes sense in a dynamic web.

These past few weeks, I have been progressively focusedeye-to-eye with trying to dig deep and unveil any remaining issues and it has been fun.

It’s been a real treat observing the progression from design to implementation of this feature and can’t wait to see it ship with Firefox 3.5 and how it will grow in the near future.

Tomorrow is a MoCo company wide internal test of Firefox 3.5 Preview Release, let’s work together to iron out any hidden creases in HTML5 video, and across the entire board in order to bring forth the next iteration of the browser by the people for the people, they deserve it!

Cheers,

Aaron Train (AaronMT)

Posted: June 11th, 2009
Categories: Mozilla Internship, Open Source
Tags: ,
Comments: No Comments.

Exploration of Reftests

This week, my second week down here at Mozilla has been an interesting week as I had the opportunity to explore a variety of hot listed (a list of bugs that need test development attention) bugs found within the layout component – see the bugs.

In particular, I have analyzed a variety of the hot listed and decided to pick up on writing invalidation reftests for the bugs that give me a starting point, in my case – a test case.

The bugs I have written invalidation reftests for this week, and, am continuing to correct and finalize include:

Bug 437704 SVG rendering stops, is a very easily identifiable regression that is in fact, visible in the browser between that of current Firefox 3.0.x and any recent Minefield release (as of writing, I am testing in Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090508 Minefield/3.6a1pre. A problem exists in the layout rendering engine where an SVG graphic (Scalable Vector Graphic, an XML specification and file format for describing two-dimensional vector graphics, both static and animated) does not completely render. See screenshot below.

On the top (or left depending on your screen width) we have Firefox 3.0.10 and on the bottom (or right depending on your screen width) we have a recent build of Minefield (3.6a1pre), where Minefield (1.9.2a1pre) renders correctly and Firefox 3.0.10 (1.9.0.10) does not.

left right

The reftest would be interesting in that, despite this scenario being difficult to duplicate as a reference, one might simply use the perfect rendering as the reference for comparison to the test. The image on the left should ideally render complete and look like the image on the right. The test would pass and only pass if every pixel rendered is an exact duplicate of the reference (in this case, the perfect rendered copy).

You can in fact test it out right now, no tools necessary. If you’re on Firefox 3.0.x (1.9.0.10), simply click here – the image is supposed to display the average gasoline prices per country – but alas the image does not render properly, or in fact completely. If you’re on a newer build of Firefox 3.5 (Shiretoko)  or Minefield 3.6a1 (1.9.2a1pre) try loading the same image – the results are what you would expect.

As this week comes to a close, I look forward to next week to make any revisions in my tests and move on to other bugs.

Cheers,

Aaron

Posted: May 15th, 2009
Categories: Mozilla Internship, Open Source
Tags: ,
Comments: 2 Comments.

They call it Mozilla

They call it Mozilla. Home to many open source software projects, ranging from Firefox and beyond – and boy does the keyword ‘open’ ever so stand out.

Having worked three days at Mozilla (building K) is surreal. As mentioned on the wiki, I have been ‘splashed’ with the Mozilla hose! From bewilderment to clarity and astonishment to excitement, my last three days can relate to a unique roller coaster ride.

Mozilla is unlike any office I have envisioned or have worked in before. From the surprisingly large bottom floor open area with the sectional couches, lawn chairs, bean bag chairs and projector screen to the open area conference rooms and work stations, Mozilla truly understands what being open is all about. The openness and split from the ‘norm’ definitely brings forth a true sense of comfort. When I sit on the large sectional couches, I cant help but envision sitting in a friend’s basement and I understand why – it brings about the most interesting ideas, discussions and topics.

The people I have met so far are all truly passionate about their work and it definitely shows when the opportunity arises through weekly meetings. Having attended three meetings, I have heard the thoughts of many unique individuals speak passionately about the work they do. Of the three, from platform discussion to weekly QA to last Monday’s ‘all hands’, each a one-of-a-kind event.

They call it Mozilla because they are about openness and difference and it demonstrates – they really are a workplace like no other. I am happy to contribute through my internship this summer.

On a more technical note, I am working on writing tests for bugs that bring forth rendering issues in the layout engine caused by invalidation. The type of tests are considered reference tests or reftests. They traditionally work by taking a snapshot of the entire window at the end of the test and comparing that to a snapshot of the reference page.

However, there’s a fairly large class of bugs classified as “invalidation bugs” — they only show up when you redraw part of a page, and when you draw the whole page everything’s fine. This is where the new form testing comes in that I am currently focusing on.

An example of a bug I picked, is bug 449362 – where in the past, simple HTML table borders have been rendered incorrectly when table cell sizes changes due as a result of running JavaScript.

Only three days in and lots more to come so stay tuned – I know at least one is waiting :)

Cheers,
Aaron

Posted: May 7th, 2009
Categories: Mozilla Internship, Open Source
Tags:
Comments: No Comments.

In a world without our hands

Ever stop and think about how much we rely on our hands to manifest and transcribe our intricate thoughts to actual code? Much like the inner workings of a compiler taking language and spitting out machine code, and a musical composer in an symphony hall , there is a profound relationship.

One’s first path of assistance would venture down the realm of speech-to-text, but really how viable is this solution?

Nuance’s Dragon software line is the epitome of speech-to-text software. They have legal, medical and various other industry customized solutions, but what about a software line that was tailored to Microsoft’s Visual Studio?

Imagine a customized solution for such an IDE. It could leverage Intellisense to work through the various commands as you go and when you want to use a variable (something that is NOT a predefined word in the intellisense dictionary that Dragon could use to match all words against) you could give a command like ‘UDV – variable’sName’ either spelled out or trained.

Being able to bind to Intellisense for all possible voice commands would seem to make it a much easier task and then with break words that you would say first then followed by an IDE command like “Compile – No Debug”, etc…

I can’t see why this isn’t possible.

For the sake of comedy, look at this for programming with voice recognition that exists today:
[youtube=http://www.youtube.com/watch?v=KyLqUf4cdwc]

In my opinion, speech-to-text as a solution for programmers who are physically disabled has a long way to go. With the delicate syntax of languages and the perfection of the software interpreter taking our voice and transcribing it as intended is an aspiration. Simply put, as the video above demonstrates – what should be simple, becomes a tedious ache.

Surely there must be folks out there considering the necessity to expand, improve and work to solution. If so, please reply, I’d be interested in the results.

As for the open source helping hand, one project I have stumbled upon is CMUSphinx: The Carnegie Mellon Sphinx Group Open Source Speech Recognition Engine.

This group of individuals are working together in an open environment in order to stimulate the creation of speech-using tools and applications, and to advance the state of the art both directly in speech recognition, as well as in related areas including dialog systems and speech synthesis.

It would be interesting to see the world of open source development work first hand on such a huge issue since we have yet to see any big-name speech-to-text companies provide a viable solution.

Cheers,
– Aaron

Posted: February 25th, 2009
Categories: Human Factors, Open Source
Tags:
Comments: No Comments.

Songbird 1.0 – Soma.FM ?

Time and time again, I often find myself listening to music while studying. As exams draw near, I enjoy having internet radio play softly (or at least attempt to) while I crack open the course book and or lecture notes. Having just formatted my laptop yet again, I wanted to try out something fresh and new.  A recently interesting article at  Ars Technica about Mozilla’s new media player, Songbird hitting the release milestone of 1.0 and my involvement with Mozilla this semester, ideally warranted the perfect opportunity to try out Songbird. Low and behold a great product, features a plenty but some, I can’t see myself ever using,  i.e., muxtape and Last FM – I was pleasantly surprised. I was also shocked to see that under Radio Stations, Shoutcast but not Soma FM. Soma FM is 14 unique channels of listener-supported, commercial-free, underground/alternative radio broadcasting from San Francisco.

This calls for the power of addons.

So for all you Soma and Shoutcast fans out there, stay tuned as this holiday break as I want to utilize the skills I learned this semester, using XPCOM/Chrome/XUL and write a Soma FM addon for Songbird. I picture the addon just sitting below Shoutcast on the left sidebar and it very similarly listing Soma FM’s stations.

Any other Soma listeners out there?  Anyone else want to collaborate?
www.somafm.com

Posted: December 7th, 2008
Categories: Open Source
Tags:
Comments: 4 Comments.

Milestone 0.3 (Audio / Video HTML5 Firefox Unit Tests)

Milestone 0.3 (Audio / Video HTML5 Unit Tests)

My HTML5 Audio / Video Unit Test(s) – Complete

Video/Audio Testing Area Video/Audio Unit Test (My Work)
Video and Audio Test Plan test_readonly.html & test_continueplay.html & test_multipleplayback & test_reload.html file.html & test_mimetype.html & test_tableembed.html & seek.ogg& 320×240.ogg r11025_s16_c1.wav & r11025_u8_c1.wav

Package Archive: click here

* The above are all mochitests, clicking on them will do nothing  – CTRL U to view code*

* To run these tests you need Firefox 3.1.*Running select tests *

To run a single test or a subset of the entire Mochitest suite, use the –test-path option to specify the test or the subdirectory of tests that you want to run. For example, to run only the test test_readonly.html in the Mozilla source tree, you would run this command:

python runtests.py –test-path=content/media/video/test_readonly.html

To run all the tests in content/media/ , this command would work:

python runtests.py –test-path=content/media/video

Note that the path specified by the –test-path is the path to the test or directory within the Mozilla source tree. If the path is a directory, then the tests in that directory and all of its subdirectories will be loaded.

My Video/Audio Tests:

  • test_readonlytests that attributes pertaining to video/audio can not be changed or altered
  • test_reload / filetests that both a reload of a window and video work correctly, i.e., playback restarts
  • test_multipleplaybacktests that six or more videos work properly when played simultaneously, playback works
  • test_tableembedtests that the new video element functions correctly when embedded in a table
  • test_mimetypea future test that will test canPlayType() [upon implementation] testing obscure codecs and media MIMETYPES
  • test_continuePlaytests that playback on a video will continue to play regardless if focus is in a newly opened tab

E-Mail convesations with Clint Talbert(Example) http://matrix.senecac.on.ca/~amtrain/other/email3.jpg

What I learned?

  • October / November
    • Audio / Video HTML5 WHATWG Elements
    • Mochitests – What/Why/How
    • Chrome Elevation Techniques for Mochitests
    • Observers/EventListeners

With the completion of milestone 0.3, I have learned so much from one course over the course of four months that I am tremendously appreciative of. Coming into Mozilla, I had only touched on Unit Tests once in my programming diploma program. Now I feel comfortable in writing any test.

Community Interaction

Unlike in Milestone 0.3, this time around I primarily interacted through #qa and through conversation in email.

Challenges

Major challenges:

  • (1) Halting focus on Private Browsing and leaping into Audio Visual / HTML5 provided was for me challenging as I had felt comfortable in the area I was originally focusing on.
  • (2) Seeking assistance from those working on Audio Visual / HTML5 aspects rather than those working on Private Browsing
  • (3) Much quieter bug on Bugzilla – a challenge seeing what’s new/what’s happening.
  • (4) Mochitest Chrome Privilege Elevation -> Netscape thing!
  • (5) Picking unit tests that I felt comfortable in pursuing.

Achievements

Upon completing DPS909,  and obtaining real life experience with Mozilla and that of QA Unit Testing, I feel empowered in the sense that I feel comfortable working on different other assignments like the jump from Private Browsing to Audio/Video HTML5.

Although my, ’0.3′ is not a product like some other projects, it was a demonstration of my will to succeed and the determination to help contribute to an overall cause – that to which I am proud to be a part of.

Conclusion

If you’re reading this far you must be Dave Humphrey, in that case – Thank You for establishing the best non-conventional class I have taken at Seneca. The knowledge and experience gained far outweighs that of sitting in a lecture room for 2 hours looking at slides twice a week every week. It’s real life experience, it’s the essence of purpose that Seneca provides.  It’s working with real projects, real problems, real issues, with real people. A non superficial course, about time.

“DPS909 and Mozilla, A++++, would recommend”

Happy Holidays Seneca/Mozilla!

Cheers,

Aaron Train

Posted: December 6th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Progress on HTML5 <video> & <audio> testing

Testing on the new HTML5 <video> & <audio> so far has been interesting yet rather challenging as I am exploring some new territory. For example; I wanted to open a new browser window from within my test, thus requiring an elevation of chrome privilege. To get access to the chrome level XPCOM interfaces I utilized netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

I need this authority as a test I am working on; a video playing during a window reload should seek to the beginning essentially requires the authority to have access to the current window in order to reload it. Now to get access to that current window I would be looking at nsIWindowMediator interface. As time progresses and despite my being in ‘0.3‘ territory – learning, exploring and questioning has yet to cease. As I have shifted from private browsing to HTML5 audio/video, it has been a welcoming challenge exploring even more of engine that is Mozilla.

I hope to have this one of a few tests completed by Friday :)

Cheers,
Aaron (AaronMT)

Posted: December 4th, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

DPS909/OSD600 – Contrib Opportunities

To DPS909/OSD600,

Semesters end is near and some of us want to work on some more contribution opportunities. By looking at the contribution page on Zenit, (i.e., http://zenit.senecac.on.ca/wiki/index.php/Contrib_Opportunities) it is difficult to determine was is antiquated, finished or still needs attention.

Suggestion: Please, add a ”’(still need)”’ tag in front of your postings or post a ”’(new)”’ tag in front or even blog about it.

Thanks,

Fellow Peer :)

Posted: December 1st, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Adobe's Alchemy Project

A sidestep of my ongoing project related blog posts, I wanted to voice my opinion about a new Adobe project I discovered. And yes… there is a dash and sprinkling of Open Source technology involved.

Project Alchemy.

The purpose of this project is to allow developers to compile C and C++ code into Action Script.

The questions is why?

The answer is really quite simple and twofold. Performance and Reuse. There is a lot of C and C++ libraries out there that are use for CPU intensive tasks such as video and audio transcoding, data manipulation, cryptographic functions and physics simulations. These libraries would be much more performant than trying to rebuild the same functionality with AS3 (Action Script 3).

The ability to compile these libraries into Action Script will provide real benefits by providing a bridge between C/C++ and Action Script while ensuring that the Flash Player security protection remains in place.

It is not intended to let you can go and recompile a complete C++ application into a Flash application but more the ability to leverage existing C++ libraries within a Flash/Flex application

In essence, Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2), of which Adobe has ties in with http://www.mozilla.org/projects/tamarin/ Project Tamarin!

This new technology requires Adobe Flash 10, and an example may be found here
Anyone remember Doom?

A complete port of C code recompiled from the original source for Adobe Alchemy

http://www.newgrounds.com/portal/view/470460

Posted: November 26th, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

Progress on HTML5 <video> and <audio> tag elements unit testing for Firefox 3.1

After struggling for a bit coming up with the actual implementation of different test cases, I have consulted aid from #QA and from the all knowing Mozilla Developer Center. I have now picked up the bat and am on my way to hitting the ball.

After juggling between the first of two subareas where testing is necessary: <source> tags or readonly attributes defined in nsIDOMHTMLMediaElement, I started with the latter.

The nsIDOMHTMLMediaElement interface is used to implement the audio and video media elements in HTML. Along with this interface are a supply of different attributes, many of which are readonly and are impossible to change or alter. The only way to guarantee this is through a unit test.

Let’s look at some of these attributes, the ones that currently need testing (seek, networkState, readyState excluded):

Attribute Type Description
currentSrc DOMString The absolute URL of the chosen media resource (if, for example, the server selects a media file based on the resolution of the user’s display), or an empty string if the networkState is EMPTY. Read only.
duration float The length of the media in seconds, or zero if no media data is available.  If the media data is available but the length is unknown, this value is NaN.  If the media is streamed and has no predefined length, the value is InfRead only.
ended boolean true if playback has finished.  Read only.
error nsIDOMHTMLMediaError The media’s error status.  Read only.
paused boolean true if the media playback is currently paused.  Read only.
totalBytes unsigned long The length, in bytes, of the media resource.  If the length is unknown, or the content is streamed and therefore has no specified length, this value is 0.  Read only.

A simple snippet example would try and alter the values for these readonly attributes and the test would determine if any of these values changed.

Simple test but nonetheless an important one. For example; I wouldn’t want a script changing the currentSrc, (i.e., current source) of my video to a binary file during execution and causing a crash of the browser. It’s important that these attributes never change.

Hope this provides some insight into what I am working on now at the moment.

Cheers,
Aaron

Posted: November 24th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

An outlook at the major areas of the audio/video testing plan for Firefox 3.1

The <video> and <audio> HTML5 tags and elements new in nature require extensive testing that require strictly written unit tests that, in essence, contract that the piece of code may satisfy.

Having a look at the recent video and audio test plan -  recently updated here: https://wiki.mozilla.org/QA/Firefox3.1/Video_And_Audio_TestPlan; there are areas already covered with a sufficient amount of testing as well as other areas of the testing plan need to be tested.

Tests for the areas already covered may be found here: mozilla/ content/ media/ video/ test/ of which tests include:

  • Test control toggle to determine if the controls appear and that the controls appear properly: test_controls.html
  • Test autoplay to ensure proper default and can be set to proper values: test_autoplay.html
  • Test that currentTime returns currentTime inside the video: test_currentTime.html
  • Test duration of a video that is not buffered: tst_duration1.html
  • Test that ended event gets sent and currentTime set properly: test_ended1.html
  • Test that ended event gets sent and currentTime set properly for buffered video: test_ended1.html
  • Test that playback can be restarted: test_ended2.html
  • Should not be able to set networkState: test_networkState.html
  • Test paused: test_paused.html
  • Test cannot set readyState: test_readyState.html
  • Test that volume setting works: test_volume.html

As one can observe, quite a few number of tests have already been written for the new tags. The areas of which that still need focusing that I find interesting are:

  • Testing the ‘Souce Element’
    • Especially now that the attribute isn’t required (i.e., http://blog.whatwg.org/this-week-in-html-5-episode-13), test will be required with and without it.  The <source type> attribute is now optional. If you aren’t sure what kind of video you’re serving, you can just throw one or more <source> elements into a <video> element and the browser will try each of them in the order specified.
  • Testing read only Attributes
    • Testing is required for read only attributes of video/audio elements that the user should not be able to mess with.  For example, any read only attributes for the source tags would need testing

    Testing seeking capabilities

    • Tests already exists for seeking capabilities but more might be necessary in order to test odd/unusual invalid data.

These areas provide a general sense of the testing involved for both audio and video tags and provide some insight into the testing plan for this area. For my 0.3, I hope to cover some of these interesting areas.

Detailed audio/video plan: https://wiki.mozilla.org/QA/Firefox3.1/Video_And_Audio_TestPlan

Cheers,

Aaron

Posted: November 20th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Experimenting with the source element in Firefox 3.1

Voila, the source element has four attributes, two of which are most important – src and type

  • The source element allows authors to specify multiple media resources for media elements.
  • The src attribute gives the address of the media resource. The value must be a valid URL. This attribute must be present.
  • The type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it. If specified, its value must be a MIME type. The codecs parameter may be specified and might be necessary to specify exactly how the resource is encoded.

Currently only OGG containers are supported in Firefox 3.1

Simple snippet might look like this.

<html>
<body>
<video id=”v1″ controls=”true”>
<source type=”video/ogg” src=”http://tinyvid.tv/file/11iyeh1k63cs0.ogg”>
<p>Sorry, your browser does not support the <video>element.</p>
</video>
</body>
</html>

End result, is a really sweet Star Trek trailer http://tinyvid.tv/show/11iyeh1k63cs0

- AaronMT

Posted: November 19th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Private Browsing – Session Store Unit Tests – Milestone 0.2

Private Browsing – Session Store Unit Tests – Milestone 0.2

Session Store Unit Test(s) – Complete

Private Browsing aims to help you make sure that your web browsing activities don’t leave any trace on your own computer.  It is very important to note that Private Browsing is not a tool to keep you anonymous from websites or your ISP, or for example protect you from all kinds of spyware applications which use sophisticated techniques to intercept your online traffic.  Private Browsing is only about making sure that Firefox doesn’t store any data which can be used to trace your online activities, no more, no less.

In my second testing area, the act of not storing any data was meticulously reviewed.The second testing area, session store, is a second testing area I have focused on for my DPS909 project. The following is a visual representation of the testing that follows the testing plan I followed for the first unit test (A):

* The second unit may be found here, browser_248970_b.js alongside the sample test HTML file used may be found here

The following plan, follows the first unit test I wrote for session store, it is as follows (following the landed unit test: browser_248970_a.js)

  1. Open a tab (a)
  2. Remove the sessionstore.js file to guarantee that it is recreated when entering private browsing mode (session store)
  3. Enter private browsing mode
  4. Record the time stamp of the new sessionstore.js file – session store
  5. Add a new tab (b) and new tab (c)
  6. Close all three tabs (a, b, c)
  7. Record the time stamp of sesionstore.js – session store
  8. Exit private browsing mode
  9. Compare session store timestamps or pre and post browsing mode

Essentially,

  • On entry:
    • Save session, close all tabs, open a blank tab.
  • During:
    • Do not save any session data to disk, keep undo close tab data in memory.
  • On exit:
    • Clear all session data in memory, load saved session from disk.

The following plan, follows the second test I wrote for session store, it is as follows (following the landed unit test: browser_248970_b.js )

The plan makes sure that the session store remains functional during the private browsing mode. The “Browser Tests” part in the test plan is about ensuring this. I tested to ensure that that the private mode does not break functionality of the session store API. which is used elsewhere in the code (for example, that of duplicateTab method).

  1. Get the closed tab count of the current browser session
  2. Set up a state for Tab (A) and open new tab (A)
  3. Populate Tab (A) with form data
  4. Close Tab (A)
  5. Verify that the closed tab count has increased
  6. Verify that tab is in the undo list
  7. Enter private browsing mode
  8. Setup a state for Tab (B) and open new tab (B)
  9. Duplicate tab (B) to new Tab (C)
  10. Verify that it was duplicated properly
  11. Close tab (C) and (B)
Private Browsing Testing Area Private Browsing Unit Test (My Work)
Session Store Unit Test browser_248970_a.js & browser_248970_b.js & browser_248970_b_sample.html

Visual Representation of Session store testing area -> My Blog – Click Here

My tests have landed into the mozilla cross reference and are included in the trunk ready for Firefox 3.1! Ss_landing.jpg

What I learned?

  • October / November
    • More on Private Browsing – Functionality, features and usage, specifically session store, downloader manager, memory hashtables
    • Chrome Browser Tests – Similarities and differences between these forms of tests and XPCSHell unit tests
    • Writing Browser Tests using sample HTML files, manipulating session store data across entry and exit of private browsing mode
    • Other, multitude of other associated bugs related to #248970

With the completion of milestone 0.2, the deadline for Private Browsing testing has expired! Private Browsing has landed into Firefox 3.1!

Next milestone release will shift focus into testing audio and video tags in Firefox 3.1  – the newly supported HTML5 feature!

Community Interaction

Unlike in Milestone 0.1, this time around I primarily interacted through #developers and through conversation in email.

Stay tuned for more!

Cheers,

Aaron

Posted: November 15th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

My first XPCOM Extension (Lab)

Through completion of my first implementation of a simple XPCOM extension, I have learned an assortment of many unique and interesting things.

On completion of the lab, to which I was to setup, make and install a simple XPCOM extension that adds two variables via chrome interface, I learned that:

  • XPCOM has multiple language bindings
  • XPCOM has IDL descriptions so programmers can plug their custom functionality into the framework and connect it with other components.
  • XPCOM is one of the main things that makes the Mozilla application environment an actual framework.
  • It is a development environment that provides the following features for the cross-platform software developer:
    • Component management
    • File abstraction
    • Object message passing
    • Memory management

Minor detail adjustments in changing this tag in the install.rdf file:

<em:maxVersion>3.0b2pre</em:maxVersion> to 3.1b2pre

Screenshot of the installed XPCOM Extension.

XPCom Installed

XPCom Installed

Cheers,

AaronMT

Posted: November 15th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Looking out at the horizon towards 0.3

If you have a downloaded a relatively new nightly or have pulled the Mozilla Trunk trunk from Mozilla-Central as of recent, you will see that Firefox 3.1b2pre has Private Browsing. It has indeed landed! And I must say that the experience I had contributing towards its finalization, in terms of writing an assortment of unit tests, was pleasantly rewarding – both in terms of knowledge gained and the warm fuzzy feeling of knowing that the opportunity to chip in on the new feature – that will be used by people all over the world -  is something I feel very proud and passionate about.

Now that the private browsing is ready, I will be shifting focus tothe final remnant – 0.3 ‘release’ towards another really cool area of Firefox 3.1 – the testing of <video> and <audio> tags.

Firefox 3.1 now has support for these new HTML tags: <video> and <audio>, part of the fifth HTML revision (HTML5). It implements the WHATWG specification for these tags. So, far, only the ogg-theora codec support has landed.

Essentially, one now is capable of including a video file directly into a web page as though it were an image, as simple as this:

<html>
<body>
<video src="myvideo.ogg" controls="true"/>
<audio src="myaudio.gg" controls="true"/>
</body>
</html>

And your audio or video will be able to be ready to go!

A simple test can be written extremely easily (http://people.mozilla.org/~ctalbert/video-simple.html), voila

<html>
<body>
hi this is a test
<p style="border: 1px solid green">
<video id="v1" src="A_New_Computer--small.ogg" autoplay="1" controls="true>></video>
</body>
</html>

Both audio and video are live in the current nightly builds of Firefox 3.1, so you don’t need try server builds or any of that.  For reference, one may find the current open bugs here: http://tinyurl.com/63hbvf

At the moment, I am still shaping a scope around what specific testing plan I may contribute to https://wiki.mozilla.org/QA/Firefox3.1/Video_And_Audio_TestPlan but am eageraly excited to see whats around the corner both with this testing area and with whats in store for future releases of Firefox.

Stay tuned for more coming soon,

Cheers,

Aaron

Posted: November 13th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Private Browsing & Session Store Unit Tests

Private Browsing aims to help you make sure that your web browsing activities don’t leave any trace on your own computer.  It is very important to note that Private Browsing is not a tool to keep you anonymous from websites or your ISP, or for example protect you from all kinds of spyware applications which use sophisticated techniques to intercept your online traffic.  Private Browsing is only about making sure that Firefox doesn’t store any data which can be used to trace your online activities, no more, no less.

In my second testing area, the act of not storing any data was meticulously reviewed.The second testing area, session store, is a second testing area I have focused on for my DPS909 project. The following is a visual representation of the testing that follows the testing plan I followed for the first unit test (A):

* The second unit may be found here, browser_248970_b.js alongside the sample test HTML file used may be found here

The following plan, follows the first unit test I wrote for session store, it is as follows (following the landed unit test: browser_248970_a.js)

  1. Open a tab (a)
  2. Remove the sessionstore.js file to guarantee that it is recreated when entering private browsing mode (session store)
  3. Enter private browsing mode
  4. Record the time stamp of the new sessionstore.js file – session store
  5. Add a new tab (b) and new tab (c)
  6. Close all three tabs (a, b, c)
  7. Record the time stamp of sesionstore.js – session store
  8. Exit private browsing mode
  9. Compare session store timestamps or pre and post browsing mode

Essentially,

  • On entry:
    • Save session, close all tabs, open a blank tab.
  • During:
    • Do not save any session data to disk, keep undo close tab data in memory.
  • On exit:
    • Clear all session data in memory, load saved session from disk.

The following plan, follows the second test I wrote for session store, it is as follows (following the landed unit test: browser_248970_b.js )

The plan makes sure that the session store remains functional during the private browsing mode. The “Browser Tests” part in the test plan is about ensuring this. I tested to ensure that that the private mode does not break functionality of the session store API. which is used elsewhere in the code (for example, that of duplicateTab method).

  1. Get the closed tab count of the current browser session
  2. Set up a state for Tab (A) and open new tab (A)
  3. Populate Tab (A) with form data
  4. Close Tab (A)
  5. Verify that the closed tab count has increased
  6. Verify that tab is in the undo list
  7. Enter private browsing mode
  8. Setup a state for Tab (B) and open new tab (B)
  9. Duplicate tab (B) to new Tab (C)
  10. Verify that it was duplicated properly
  11. Close tab (C) and (B)

Visual Representation of the first unit test

Step 1: I Open a new tab and removed my current sessionstore.js file in my profile.
At this point, I have made note of the current time stamp.

Step 2: I am presented with the *current* visual representation of entering Private Browsing Mode.

Step 3: Here I made some alternations to my Private Browsing session by opening two other tabs.
The time stamp must not change or be written to on disk.

Step 4: Exiting private browsing mode

Step 5: Back to my regular browsing session

The time stamps should be exactly the same as no changes to disk have been made. Private Browsing mode works.

In the case of the visual representation.  I opened the sessionstore.js properties in windows and took notice of their timestamps. Believe me when I say that there were no changes written to disk:

Pre Private Browsing Mode November 8, 2008, 12:17:55 PM
Post Private Browsing Mode November 8, 2008, 12:17:55 PM

Hope this visual representation of my projects second testing area provides you with some insight and knowledge into the private browsing functionality that recently landed.

Cheers,

- AaronMT

Posted: November 8th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Torvalds on politics

A recently written blog post by Linus Torvalds provides a detailed sentiment about the common concept of thinking in either black or white, focusing on the topics of Richard Stallman, GPLv2 and the President Elect Barack Obama. In essence, Linus expresses the uneasiness most of us feel about black and white thinking, or rather single-issue people.

In regards to FSF and GPLv2, understandably, Linus’s sees Richard as a one-sided figure or element that, in his mind, is not particularity useful. He explains that Stallman, among others view issues with a very closed mind. The fact is, there aren’t just two sides to any issue, there’s almost always a range or responses, and “it depends” is almost always the right answer in any big question. And not being even willing to see the other side makes for bad decisions.

More importantly, on the focus of the posting, Linus feels the same for the recently defeated republican party down south. He appraises Obama for not falling into this category.

I’m certain that what Linus sees in Obama is what many others see as well – looking beyond his experience of making policy in the US, his ability to think and analysize all situations are rather positive. Even though one might consider his views “indecisive”, it’s a good thing.

Linus explains that one must not be 100% all gung ho towards a particular issue, one must always analysize and evaluate.

Linus makes a great point here, “I love seeing people who are really passionate about what they do, and many people have something they really care about. It’s just that when that becomes something exclusionary, it often gets ugly. It’s not passion for something, it becomes passion against something else.

Without getting into a political debate; as a Canadian, I can only assume that the awareness of those who see this problem, discovered that John McCain (an honorable person) did not inspire leadership and consistency; thus a close minded individual.

Nothing in life should be ‘black’ or ‘white’.

Overall, reading his recent posting offered wise, thoughtful and insightful words for these confusing times. The posting touched on areas of open source but primarily focused on the politics down South.

Linus Torvalds blog can be found here

Cheers,

Aaron

Posted: November 8th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Bug found in a bug posting about a bug found within a test

Today, I was notified in regards to a bug found in a bug posting about a  bug found within a test – one of my tests, that I had previously been working on.

The bug found here, at #462794 outlines a bug where Browser chrome tests for session store closes the browser window.

In detail, by running the the following command:

python runtests.py --browser-chrome --test-path=browser/components/sessionstore

This would start the test and the bug herein lies that the main browser window would close along the way.

Luckily, the problem was found quickly and the issue resolved with -
Attachment Patch (id=346073) [details]

As a result, this is my first encounter with bugs found in a test or patch that is supposed to fix bugs.  Rather unique experience I must say, as I have not dealt with Bugzilla postings that fall into the exact category as the name of this blog posting.

Aaron T

Posted: November 4th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

FSOSS – A presentation/discussion that students would truly embrace

Reminiscing about my first experience at a symposium, I saw a number of very interesting presentations.

These presentations albeit very interesting provided, helped develop and expand our minds in interesting and unique ways. But, post FSOSS 2008 there is a presentation or perhaps a workshop that I and can only imagine majority of other students would be interested in. It would have been nice to have a presentation detailing the topic of how to job search in an open source world.

What I mean by this is, what are the best/most appropriate and perhaps even statistically proven methods a student can take the moment he walks out the college door for the last time.

Is job hunting in the open source world any different than that of any conventional proprietary software firm? What have students in the past done that is different? Is there even a difference? How do I advertise myself? How do I become an entity that is desired in the open source world?

We learned in DPS909 that having a blog and making yourself active online and through communities is best, but what about all the dozens of Toronto/GTA open source firms that scour for employees differently? Again I ask, is this any different than any conventional proprietary software firm.Surely there’s more to it than a blog and a profile, but is there?

Am I envisioning this differently? If I want to be hired so I can earn a salary, I can’t picture these open source software firms posting career ads in a local newspaper.

What have those in the open source world and are actively employeed do to find a place to work, is this any different than conventional software firms?

Surely, I am not the only student who thought of this. I believe A FSOSS presentation that would have raised and addressed this question would have helpful and interesting and beneficial to me as a student at Seneca College. It would best be geared towards students. It could provide insight to direct me for my first steps out the door.

Just my $.02

Cheers,

- Aaron T

Posted: October 31st, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

Lab 7 – (Modifying Mozilla Firefox's Tab Behaviour)

This lab, I found to be quite challenging yet unique and interesting at the same time. Utilizing the knowledge learned from previous lectures, I discovered that I became quickly familiar with the Mozilla tree and searching through MXR and the directory structure of the debug build we were using. The specific goal of altering the behaviour of the tabbed browsing functionality was a great choice as it was not too difficult nor too easy.

Following the lab, I wound up digging through the rabbit hole, and landed in mozilla/ browser/ base/ content/ tabbrowser.xml looking at lines: #1165 and #1228

Admitedly, the hands on approach of the lab aided in the specific areas to change. I believe that without the aid, I would have certainly found the specific file, tabbrowser.xml but the code to be changed would require a considerable amount of investigation before editting.

The code that I did change was similar to that in the lab.

// Insert tab after current tab, not at end.
var currentTabIndex = this.mTabContainer.selectedIndex; this.mTabContainer.insertBefore(t, this.mTabContainer.childNodes.item(currentTabIndex + 1));

Having then compiled this code, I discovered the same bug posted in the lab. The functionality works – tabs open after the currently selected tab,  but tabs would not close.

Post compile, I continued to read the lab and mimicked the changes by altering line #1228.

var position = currentTabIndex + 1

Prior to this change, the current position based on the number of tab nodes was used. With this change, this solved the close tab issue, but alas again, more buggers. With two tabs open, when you close one, they both close – interesting.

Anyhow, I learned how fragile some code can be. It reminds me of a deck of cards built into a house, you have to be very careful which cards you wish to remove or add to your masterpiece. Altering a single line changed other lines. Mozilla is right when they name dev/unstable builds, Minefield. You have to observe everything you do and watch where you step.

Cheers,

Aaron (AaronMT)

Posted: October 28th, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

Private Browsing – Give it a try!

The first bits of the private browsing patch have landed!

As of recently, the Private Browsing feature has just landed onto the Firefox trunk, disabled at the moment, it is to be ready for the release of Firefox 3.1

Here are some quick facts:

  • The cut-off date for the remaining puzzle pieces is by the end of October 26th.
  • A test week for the community will commence during the week of October 27th.
  • Tests have been written (my project!) according to this functional specification, but human testing is still required.
  • Stay tuned for more details!

Technical details:

Details of what landed:

Please, give it a try (try server builds). Tell me what you think – of course, you’ll be a contributor!

E-Mail me your findings of unexpected behavior or post on #248970.

Full details of the landing can be read at Ehsan’s blog.

Cheers,

AaronMT

Posted: October 20th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Private Browsing – Unit Testing Area – Places Released & What's Next?

Hot off the presses arrives my first ‘release’ of the first testing area that I selected back in September. Private Browsing, a feature (to be landing very shortly) obviously needs extensive testing and the area I first selected to work with is, the testing area/component places, or what you know as history and bookmarks. Unlike a typical release, I will be focusing on different testing areas to help contribute towards the success of private browsing, therefore, in my context, a ‘release’, has a different meaning. Each successful testing area builds upon one another so that come late November, I will have developed a testing suite of the areas that need extensive testing. The testing plan can be seen here.

Now, about my first testing area I have completed -

Places Unit Test – Complete / Milestone 0.1 Achieved

Private Browsing Testing Area Private Browsing Unit Test (My Work)
Places Unit Test test_248970_history.js
Visual representation of this testing area – Click Here (older blog post)

To test out the unit test

The unit test must be placed in ‘src/toolkit/components/places/tests/unit

make SOLO_FILE=test_bug248970.js -C objdir/netwerk/test check-one

What I learned through September & October?

  • Mozilla Tree – Structural Layout
  • Unit Testing – How to write a unit test
  • Private Browsing – Functionality, features and usage
  • XPCShell – When it’s used, how it’s used, why it’s used
  • Blocker/Dependency Bugs
  • Patches – How to apply the following patches: #248970 #457110 #458954
  • Building – Clean builds with fresh applied patches
  • Philosophical Question + New Bug: #454752

Community Interaction through September & October

1. Whenever I ran into trouble, I confronted the Mozilla Developer Centre. Majority of the time my answers were addressed there to questions raised. When I could not find an answer to a specific issue, I contacted (2) Ehsan.

2. Ehsan, very kindly without hesitance provided me with the support I needed in jumping into the unfamiliar world of Mozilla. During the first milestone phase we discussed many topics such as: private browsing, patches, places, session store, unit testing, XPCShell testing, chrome browser testing.

3. Of course the friendly help of peers and professors and other Mozilla developers derived from channels on irc.Mozilla.org, IRC.

What’s Next?

Next stop —- Session Storage http://aaronmt.wordpress.com/2008/10/11/next-stop-session-storage/

Work has begun on the next testing area focusing on the chrome-browser unit and browser tests handling session manipulation on-entry – in-between and on-exit of private browsing sessions. This testing will be complete shortly as of next week due to the following:

As of recently it has arisen that work on the testing areas needs to be completed sooner then expected as Mozilla is on a completely different schedule than mine – which is of the norm. This fact is something I have come to accept and learn. Thank you Dave Humphrey for helping me consult the fact. Private Browsing is to be landing shortly into Mozilla Firefox and that is awesome, I love working on new technology and software that people will actually be using, and to help contribute towards it is brilliant. Selecting this project, I honestly had no idea that the feature was being worked on to be included so quickly – but that is 100% OK. Testing is never complete and there are similar and many other areas where testing is needed, which is perfect!

So my next ‘release’ will contain my next testing area and testing of another Mozilla area that does not need immediate completion so that I can in essence, take it easy, I have four other courses! I would have enjoyed working more on private browsing but it is nearly ready to be used by you and I (if you’re wondering, some other testing areas were already written by my mozilla contact).

Anyhow, keep up with the information in #248970 & http://planet.mozilla.org/ – private browsing is nearly ready!

PS: Need more contributors for private browsing, visit my wiki contribution page or ask for help on IRC (AaronMT)

Cheers, see you guys @ FSOSS

Aaron

Posted: October 19th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Firefox Tip: Auto-Hide Your Firefox Bookmarks Toolbar

So if you’re like me, you own a laptop and want as much screen space as possible to view the web. I was thinking of a way to hide my massive bookmark toolbar, yet recall it when I need it. Simply put, I want an auto-hide; kind of like the option available within your operating systems desktop.

Solution? All I had to do was add this two-liner into your profile’s chrome cascading style sheet. What’s that? It’s a file located in your profile directory, on Windows Vista, mine is
%appdata%\Mozilla\Firefox\Profiles\k42yexoy.default\chrome

userChrome.css

If the file is not there, rename

userChrome-example.css

Add the two-liner:

/* Pop-up bookmarks toolbar */ #PersonalToolbar {display: none;} #navigator-toolbox:hover > #PersonalToolbar {display: -moz-box;}

Now when you want to view your bookmarks toolbar, just hover your mouse over the area and it appears.

Cheers,

Aaron

Posted: October 17th, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

Next Stop: Session Storage

Already time has flown by and I amongst a classroom of fellow peers are working vividly on our first deliverables for our open source developement program. The time is now to shape a border around the next couple weeks to analyze, focus and define our scope for our milestone 0.2 release.

As per the focus of my project at hand, writing unit tests for the highly anticipated Firefox 3.1 feature, Private Browsing, I have selected the next area of analysis, Session Storage.

Deviating from the component named Places, I will be heading outwards towards the component named Session Store – traveling from /toolkit/components/places/tests all the way around tree to /browser/components/sessionstore/test/browser.

This new territory deviates from XPCShell Tests embraces Chrome Tests, which at this very moment I am completely unfamiliar with.

Mozilla Developer defines Chrome Tests as, “…a suite in an automated testing framework designed to allow testing of application chrome windows using JavaScript.“.

Utilizing aspects of the Mochitest framework, I will have framework designed functions and access to global objects defined in browser/base/content/browser.js.  What this means is that my code will run at the same scope as a global browser window.

My unit testing will ensure that private browsing and the session store operate together with intended functionality. Areas of testing will include a focus on guaranteeing that all session data is removed on exit after a private browsing mode session, as well as verifying that the initial session’s time stamp has not changed before entry into regular browsing mode.

This week, should I find time amongst tests, due dates, and the salvo fire of things to do before reading week, I will look at this interesting Bug #346337Form input field data not retained on session restore and practice working with its associated [http://mxr.mozilla.org/mozilla-central/source/browser/components/sessionstore/test/browser/browser_346337.js chrome test bug].

Cheers,

Aaron

Posted: October 11th, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

My experience with Mozilla/Bugzilla developer tracking

Over the past few weeks, I have watched Ehsan Ahkgari at Mozilla’s Bugzilla. Following the following bugs:

Approximately Fifty-four emails gathered into my Google Mail inbox (conversation style email collections are superb for this). These emails tracked a vast array of comments and conversation detailing information about the bugs listed above. Each email, unique in topic varied vastly per bug and per conversation with another member associated with the bug. I realized there is a lot to keep track of during a single week. It’s hard to imagine the appearance of ones inbox without conversation style groupings.

Anyhow, I think it is an excellent way to keep up to date with the happenings for a certain bug. I agree with blog poster, in the push vs pull philosophy, I prefer the push approach. It makes sense to have updates sent to you, rather then you going around searching for updates. Overall, we are a lazy society, if the information can be sent to us automatically; why not use it? Would you rather hit reload every few minutes?

- Aaron

Posted: October 9th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Bug Fixing with Mozilla Thunderbird 3.0b1pre

Week 6 (Oct 6) – Bug Fixing

Lab Details

This was quite a fun lab to do. Excluding the build process, this lab did not take too long.
To be frank, the majority of my time spent doing this lab was fixing my ~/.mozconfig file. Reason being – I have never built Mozilla Thunderbird before, so some changes and learning adaptations were necessary.

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --disable static --enable-shared
ac_add_options --enable-application=mail

For this lab, I downloaded a fresh trunk build of Mozilla Thunderbird 3.0b1pre from mercurial on Ubuntu 8.04.

hg clone http://hg.mozilla.org/comm-central/ src

Upon successful build, I confirmed the bug: improper handling of email hyper linking in e-mail messages.

My next step was to submit a bug on Bugzilla addressing the issue, which can be found here Bug #6817

Taking advantage of the nice tip posted, to peek at the code posted here:

mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp

Had this tip not been posted, I would have executed an MXR search for ‘hyperlink

Following that, I began to scour for the cause of this bug looking through the file and found the line, #197, with the following condition:

if (inString.FindChar('.', pos) != kNotFound)

For this function to perform properly, the line needs to be changed to:

if ((inString.FindChar('.', pos) != kNotFound) && (inString.Find("..",0)==kNotFound))

Next, it was time to create a patch with the updated changes:

hg diff -p -U 8 > patch.txt

The contents of the patch containing the solution to the problem can be found here, Bug #6817 – Patch

Lastly, I submitted my patch to my created bug on Bugzilla, asking for review from David.Humphrey.

Parts I found difficult:

  • Building Mozilla Thunderbird by altering ~/.mozconfig
  • Looking for the appropriate function found in mozTXTToHTMLConv.cpp file that deals with hyper linking.

Tips: Read the comments for the functions, they help identify the functionality of the succeeding code: //i.e. we want to linkify johndoe@foo.com but not “let’s meet @8pm”.

Links:

Cheers,
Aaron

Posted: October 7th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

A visual representation of my projects first testing area

So it’s a lazy Saturday afternoon and I am utilizing my time doing none other than many school assignments, when my mother asked asked me what I was up to, to which I replied, “reviewing the unit test I wrote for the Mozilla component, places”. Like any normal mom, she has absolutely no idea what that means – thus the problem.

I wanted to show her what exactly what this meant and decided to follow through with a visual representation of exactly that. A quick step by step visual walk through so that she and no doubt many others will have a clue as to what this all means.  What the heck am I working on for my first milestone of DPS909?

So the following visual step-by-step walk through should give you a visual representation as to what I am rigorously testing at the moment as a first testing area for my project.

First we obtain the latest trunk build and stick the newest private browsing patch into it so that it becomes available:

Without private browsing enabled, I am going to visit some web sites and make sure that they are displayed in the history sidebar, as they would normally.

Next, I am going to add a bookmark for a site I am on. I did it here through the star icon method of bookmarking a page.

Let me double check in the library to see that the bookmark is there. Adagio Tea’s great, visit count of 1, that’s right. I just visited once just now.

Lets say that I am now ready to enter private browsing mode. I am going to enter now, keep my same session open.

Since we’re in private browsing mode, the visit count on the same sites did not and should not ever increase. Let’s double check in the library.

Let’s visit some new sites under private browsing mode. Notice how my original sites I visited are still listed, but not the new websites because we are in private browsing mode.

Is my original bookmark still there? Yes it is. It’s there because bookmarking is not blocked under private browsing mode.

Let’s add another bookmark under private browsing mode

Lets exit private browsing mode and analyze what was recorded.

Excellent. This is exactly what I wanted. Both bookmarks retained and no new history items were inserted. The only history items available are those created prior to entry in private browsing mode. Everything was successful.

Notice CNN and Slashdot aren’t listed on the sidebar.

Hope this visual representation of my projects first testing area provides you with some insight.

Cheers,

- AaronMT

Posted: October 4th, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

Impact Mozilla

Having watched a presentation today on none other than Mozilla Firefox, a statistic was presented that deemed Mozilla Firefox having (19.48%) of the worlds usage share of preferred internet browser. The statistic was pulled from Wikipedia, so take it with a grain of salt. Anyhow, if true, that’s great, preferred internet browser.

What is that supposed to mean? Preferred over what, preferred look, preferred feel?

Anyhow, now how many are actually using the browser on a day to day basis?

A second statistic was used, mentioning that Mozilla Firefox has reached tens of millions of downloads, but only 75% of all Mozilla downloads never get used!

A bit of searching around and it was revealed according to Mozilla, that that there is a critical dilemma.

“How do we get these past users back? And how do we keep future users active once they’ve downloaded Firefox?”

Who would of thought that this is a major issue? In fact, it’s a little distressing. So distressing that Mozilla has therefore launched a contest to get input on how to solve this problem.

It raises an interesting point, why are people downloading Mozilla Firefox, and not using it?

A majority of existing Firefox users upgrade to new versions, or did so with 3.0. So, existing users seem to like Firefox and want to stay with it, helping Firefox grow to roughly 20 percent of the global browser market.

But why are people letting it sit on the top shelf?

Any ideas?

- Aaron

Posted: October 3rd, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Praise to the Mozilla Developer Center

If you have not seen me blog about it before or heard me mention it in class, I will mention it again. I can not give enough praise to the Mozilla Devleloper Center.

If you’re a developer trying to get a handle on all the new features in the world of Mozilla, it really is the perfect place to start. The article the center provide cover the widest of all areas involved with Mozilla Development.

This evening, I again found an answer to an interesting bug on a function call in my toolkit/components/places/ unit test.

A little background: My function queries history items that I have inserted and tests to see if the items were added successfully to the database, as well; a check to determine if the item has been visited.

http://developer.mozilla.org/en/nsINavHistoryQueryOptions – The service I interface these XPCom functions with ~ to Javascript XPCShell is nsiNavHistoryQuery and nsiNavHistoryQueryOptions.

Now, my problem was that I was not able to query a particular history item without recieving a false on a do_check_true check. I assumed that the problem was something related to a  AddVisit() parameter, TRANSITION_TYPE. A transition is an event, corresponding with a parameter passed to the AddVisit constructor. An example of a transition is when the user followed a bookmark to get to the page, this would be the TRANSITION_BOOKMARK macro. The one I had trouble with is TRANSITION_EMBED.

So I hopped on over to the dev center and found an attribute inside the the nsiNavHistoryQueryOptions interface. This represents the global options for executing a query on something like history items. I found, includeHidden – “If you set this flag you’ll get all items, even hidden ones…” . This sounds like the reason why my query was failing to retrieve that particular transition typed item.

I set the boolean flag, options.includeHidden = true; and re-ran my test, and success it passed.

Perfect it works. So, if you’re stuck, I cant recommend enough, the Mozilla Dev Center for finding help with your projects, it’s already worked for me a couple times. A problem like the one above would have taken me days to figure out there wasnt the information readily available. Good stuff, I’m satisfied.

- Aaron

Posted: October 2nd, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Bugzilla Lab + Project Update

“Find 3+ bugs related to your project, and add them to your project wiki page”

Project related bug: Bug #248970

Bugs related to bug Bug #248970:

  • Dependencies:
  1. Bug #456884 – Provide a way to open a link to Private Browsing Mode
  2. Bug #457110 – Support in-memory DB for the downloads manager back-end
  • Blocker:
  1. Bug #454792 – Should safe browsing code react to private browsing mode?

I’ve learned that a blocker prevents basic functionality from working multiple functions,  everything related is unusable without an immediate fix.

Collaborative work with myself and my Mozilla contact is being done on Bug #457110 which implements a download manager back-end change.  Once my Mozilla contact submits a patch, the regular private browsing patch will be split up to limit each patch to a single unit [which include test cases], that will be asked for review.

My 0.1 release is going as planned as the places component is being tested properly during private browsing mode.

- Aaron

Posted: October 1st, 2008
Categories: Open Source
Tags:
Comments: No Comments.

The Tao of Unit Testing

Careful programmers test early and test often.

As I begin to write unit tests for my project, I have decided to embrace the effective approach one must take in order to write programming unit tests and the best perspective one must posses when analyzing the usefulness of unit tests. A book, I own, title, Beautiful Code: Leading Programmers Explain How They Think” – best describes the practice of writing unit tests effectively by recognizing the fact that the unit test will motivate the code that you write. This posting will explain what this means.

Most programmers have had the experience of looking at a snippet of code and thinking it was not only functional but also exquisite. Code is typically considered exquisite if it does what it’s supposed to do with unique elegance and economy.

But what about the tests for that exquisite code – especially the kind of tests that developers write, or should write, while they are working on the code?

Any nontrivial code, exquisite or note, needs not one, but a team of tests, where each test should be focused on checking a specific aspect of the code, similar to the way different players on a sports team are responsible for different tasks and different areas of the playing field.

The main purpose of tests is to reconfirm ones confidence that the code works properly and efficiently. Therefore, to me, the most exquisite tests are those that help me maximize my confidence that the code does, and will continue to do, what it’s supposed to.

Some tests are brilliant for their simplicity and efficiency, other tests are exquisite because, in the process of writing them, they help you improve the code they are meant to test in subtle but important ways. They may not discover proper bugs or defects, but they bring to the surface problems with the design, testability or maintenance of the code.

Tests reveal ways to make code more elegant, maintainable and testable. The process of writing tests often helps you realize not only logical problems, but also structural and design issues with ones implementation. As well, very thorough tests increase confidence that the code performs as expected, not only in some basic cases, but in all cases.

Overall, one must think of testing as ones way of stepping aside from ones code to look at ones work with critical eyes and from different perspectives – it will make one a better programmer.

Cheers,

AaronMT

Posted: September 26th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Placing a patch on the Fox

For Week 4′s Lab, I am to learn how to apply patches to source code and rebuild Firefox including the updated changes. Luckily I already have a head start. Last week, I was conversing with the Mozilla contact of whom  I am associated and collaborating with on my project. Deep into the depths of the bug posted on Bugzilla lie patches written by volunteers collaborating on the bug/feature (in my case, I selected the privacy mode bug) – with the latest version being 2.9 at the time of this writing.

As my project will involve working on bleeding edge technology, the process of tinkering with code, applying, reapply and removing patches, I decided to focus this blog post and the second part of the lab, patching my build with patches posted on Bug 248970.

In order to apply the newest patch, I performed the following steps:

  1. Saved the (*.patch) file to my Mozilla Central source folder, it was shown on the bug as an attachment, Figure 1 below:
  2. After the patch was saved, I than installed it and ran patch*: patch -p1 < /path/to/the/latest.patch
  3. The next steps are the same as always, after your new patch is inserted into the source code, perform a make -f client.mk build to build Firefox with the patch.
  4. Firefox was now updated to include the particular patch you downloaded.

* – Note: patch is a Unix program that updates text files according to instructions contained in a separate file, called a patch file. The patch file is a text file that consists of a list of differences and is produced by running the related diff program with the original and updated file as arguments. In essence, I applied the patch as so one would say.

As well, Patches can be undone, or reversed, with the ‘-R’ option:

$ patch -R < mods.diff

Figure1.

To verify that the patch added this new technology:

Posted: September 23rd, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

Learning about XPCShell & Unit Tests – Part Deux

My goals for this week (even though it’s just Monday, I had time to just try it out today) were to create a simple XPCShell unit test that has access to nsIBrowserHistory through XPConnect, and perform three objectives:

  1. Grants access to the history manager through the service nsIBrowserHistory. For the sake of simplicity, I used the variable _HMSvc, in essence, “history manager service”.
  2. Creates a history entry with details, using the function addPageWithDetails. For the sake of simplicity, I used the URI, “http://www.mozilla.org”.
  3. Check the count of the history entries in the manager by using the XPCShell unit test function, do_check_eq do_check_eq(1,_HMSvc.count); – Literally comparing the number of entries against my check of size 1, “compare if both objects equal 1″.

Full script here

[sourcecode language='jscript']
var _HMSvc = null;
function get_historyManager() {
if (_HMSvc)
return _HMSvc;
return _HMSvc = Components.classes["@mozilla.org/browser/global-history;2"].
getService(Components.interfaces.nsIBrowserHistory);
}

function run_test()
{
var testURI = uri(“http://mozilla.com”);

try{
// Get the history Manager
var HM = get_historyManager();
do_check_neq(HM, null, “Retrieving the history manager failed”);
// Add a page into history using the URI, http://mozilla.com
_HMSvc.addPageWithDetails(testURI,”testURI”,Date.now()*1000);
// Check if any pages exist in the history
do_check_eq(1,_HMSvc.count);
}catch (e){
do_throw(“Unexpected exception: ” + e);
}
}[/sourcecode]

The code is simple to the trained eye. What I mean by this is I had to look at a lot of examples of unit tests before I could see a pattern of how they run, for example each unit test needs a function run_test().

Running the code involves selecting the single unit test file, which I did by running:

make SOLO_FILE=”test_historySimple.js” -C toolkit/components/places/tests/ check-one

My code runs with the output:

test_historySimple.js: PASS.

So I know my script is testing correctly.

If I pass the value of 0, I receive output of

*** TEST-UNEXPECTED-FAIL | test_historySimple.js | Unexpected exception: 2147500036.

Log Output here: http://mozilla.pastebin.com/f710dd2c5

I’m starting to get the hang of writing unit tests even though they are simple. The process to learn will continue. Example, today, I spent a few hours trying to figure out which directory the script needs to be situated in. Searching MXR, I was looking at the location of other tests, and discovered that this script specifically, would wind up (after build & relearning how to symlink) in obj-i686-pc-linux-gnu/_tests/xpcshell-simple/test_places/unit, with the original file in /toolkit/components/places/tests/unit. Hours passed and all I was reading were , “File Not Found” and “Service not available” messages. Magic happened when I placed the files in their correct spots. Im assuming by doing that, my script found the nsIBrowserHistory interface fine – I guess from a specific location it knew where to look.

Not sure how to conclude this posting but, http://mxr.mozilla.org/ – Mozilla Cross Reference and http://developer.mozilla.org/ Mozilla Developer Wiki are your friends!

Cheers,

- AaronMT

Posted: September 23rd, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Learning about XPCShell & Unit Tests

As of today – Friday, I have tightened my belt and stepped into the world of Mozilla. Taking baby steps I have begun to do some research into the focus of my selected project – which will involve collaboration with those writing patches on (bug 248970). You can’t just begin coding and racing to the finish line. I will take my time doing research to understand what I am committed towards achieving. In essence, I will be writing unit tests for special test cases for the new private browsing mode currently slated for Firefox 3.1

Referred to a tutorial on XPCShell Unit Testing by a collaborator, I took 15 minutes and tinkered around with it. Having watched Ted Mielczarek’s demo during Mozilla’s visit to Seneca, I wasn’t entirely sure of its purpose. Rather than just act as a JavaScript shell, XPCShell taps into XPCom functionality – which I assume lets your JavaScript tests have access to other functionality of Mozilla.

Simply changing values in the sample file sample-test.js, I was able to receive status of PASS or FAIL

Not much code was in the sample-test.js file, just

function run_test() {
  do_check_eq(57, 57)
  do_check_neq(1, 2)
  do_check_true(true);
  do_test_pending();
  do_timeout(100, "do_test_finished();");
}

I merely changed the second parameter of the first function

do_check_eq()

which performs an assert to check if two objects are equal. If not equal, an exception is logged and the test case is halted.

do_check_eq(57,47)

Resulted in a FAIL

*** TEST-UNEXPECTED-FAIL | */test_sample.js | 57 == 47

So XPCShell works.. at least from the tutorial I followed here

Seeing this simple example, it will be interesting to see how tests will be used to test the functionality of patches submitted according to the test plan. Testing areas include cookies, history, cache, user passwords, downloads, DOM storage etc.

My next step will be to maybe write an extremely simple XPCShell Unit Test with XPCOM interaction.

Stay tuned,

Aaron (AaronMT)

Posted: September 19th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Mozilla Developer Day @ Seneca College : Day 2

Mozilla Developer Day @ Seneca College : Day 2

After a humble day of listening to the minds behind the Moz machine speak their minds and extend their knowledge at the second day of the Mozilla Developer Days at Seneca College, I am sitting back, drinking some ti kuan yin and collecting my thoughts. In essence, this was my first Mozilla Development conference, that I have ever attended, and I can graciously say that I was pleased to attend and thankful for listening to the many topics, discussions and lastly activities that unfolded during the morning and afternoon. Hopefully many more to come, including FSOSS ’08 in October.

Absorbing the material demonstrated through today’s topics (chrome testing, mochitest testing, javascript testing, memory leaks, etc) was vastly entertaining, as many of the topics were hands-on which is *my* preferred method of learning. Listening is not enough – observing and following the meticulous demonstrations and even laugh at the cute blunders during example provided me with a realistic understanding of the topics and presenters at hand.

As well, selecting the Mozilla-Testing stream provided me with an insight and possible peak at the project I picked last night, that, fundamentally deals with tests involved in the new Private Browsing feature unreleased in Firefox. Although I did not learn which presentation would exactly aid me, I listened to them all. Better all than none. Clint Talbert (QA Developer Engineer), a contact of whom I met early this morning, will graciously and thankfully offer his experience and and knowledge, for which I am appreciative.

Speaking of other developers, through meeting some of the the Mozilla Developers today, I openly embraced the fact that they are really down-to-earth people and in essence, provided me with a realistic look at the minds behind some of the greatest software out today. This idea was brilliantly, if not, strategically reinforced by Mike Beltzner’s T-Shirt, “I am not a Robot”. Genius. Let me know if you find a shirt, “I am not a Cylon”.

Meeting the attended Mozilla developers was a blast and learning about their roles at Mozilla, even for a brief moment before they presented, was useful knowledge.

Overall, I enjoyed this developer conference, it was an enlightening experience, a lot was learned and . I left with knowledge obtained and a sticker of a bird with gas problems.

Cheers,

Aaron T (AaronMT)

Posted: September 17th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Compiling VLC 0.9.2 in Ubuntu 8.04

Hi All,

I saw that a new version of VLC has been released and considered it worthy of documenting the process to compile it, just like I did with Firefox the other day. This should be easier to do and.

Here’s my notes for installing VLC 0.9.2 in Ubuntu 8.04.

1) Download the source and extract the archive.

wget http://www.videolan.org/mirror.php?mirror=http://mirror.services.wisc.edu/mirrors/videolan/&file=vlc/0.9.2/vlc-0.9.2.tar.bz2
bunzip2 vlc-0.9.2.tar.bz2 && tar xvf vlc-0.9.2.tar
cd vlc-0.9.2

2. Make sure you have the necessary packages installed.
sudo apt-get install autoconf automake build-essential libtool checkinstall libdbus-1-dev libmad0-dev libavcodec-dev libavformat-dev libpostproc-dev liba52-dev libfribidi-dev libqt4-dev

3) Run the bootstrap
./bootstrap

4) Run the configure script (need to find out more information on switches)
./configure –enable-pulse (this is special for Ubuntu, its a module that handles audio)

5) Build the source files
make

6. Install the program
./install

Cheers,
Aaron

Posted: September 15th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

I walked through the Minefield … and built Mozilla Firefox 3.1b1pre

Minefield 3.1b1pre

Minefield 3.1b1pre

I walked through the Minefield… and built Mozilla Firefox 3.1b1pre

So watch your head rock… :)

What does this mean? A whole lot of reading, learning and embracing the unknown.

The objective was simple, download Mozilla Source Code from Mozilla-Central.Weapon of choice? The Operating System you choose to build Firefox on. Ultimately, due in reason to the fact that steps differ but the common idea and objective is the same. You need a hammer to drive the nail in the floor-board, or rather, you need the proper tools to setup an environment and build Mozilla Firefox.

My weapon of choice for tonight was Ubuntu 8.04 (Hardy Heron)

Let me just say straight off the bat. I am really surprised at the lack of problems I had. I did not rush, I spent about an hour and a half before hand reading each link posted here.

I could not get the Paul Reed or Robert Helmer videos to play with Totem in Ubuntu (I’m delegating this to a Quicktime/MOV issue) but I did indeed watch Ted Mielczarek video on Mozilla’s Build System, ofering me a reminder of the make program which I have not used since OOP244, a C++ course back in my previous program at Seneca College. It was also nice to put a face to the nickname ted in the IRC chatroom (#seneca@mozilla.org).

On to the build process..

I had a notion that building Firefox on Ubuntu or any flavor of Linux would be a heck of a lot easier than building on Windows due to access to number of commands and programs already installed and setup with the distribution, thus the reason for selecting Linux to build it on.

Like a freshman listening to a senior professor, I was confused at all these new terms being thrown around, but I am very quick learner and made sense of it all. Some of the new terms include:

  • gnu-make
  • MXR
  • Tinderbox
  • Branch
  • NSPR
  • Rules.MK
  • Buildbot – (Domi arigato, Mr Roboto?)

… and so I scoured the Mozilla domain and found answers; adding MXR to my bookmarks for obvious reasons, and found out what Buildbot is (A system to automate the compile/test cycle required by most software projects to validate code changes).

With my fork and knife in my hands, I had the tools ready to dig in. I downloaded and setup Mercurial and properly followed the ~/.hgrc setup preconditions. Connected to Mozilla-Central and cloned the repositories to my ~/Desktop.

With the source, I was now able to properly setup a ~/.mozconfig file (detailing any specific instruction you want the browser to be compiled with)

make -f client.mk build

.. and voila

<insert 45 minutes worth of compiling messages>

Firefox runs, it works, it’s alive… it’s alive

I have never built Firefox or any large application before (size of source folder unpacked is a gig) and found this lab very interesting as you have to embrace installing software/libraries and packages you’ve never heard of before in order to compile Mozilla software. For example, I have no idea what the dbus-1-glib-devel (Developer package for D-Bus/GLib bindings) is and why its required in order to build Firefox. I had heard of CVS and subversion but wanted to try out the new technology of Mercurial.

In essence, you have to close your eyes, plug your nose and jump into the world of the unknown … you have to read things twice, maybe three times in order to understand, ask for help in IRC, search newsgroups or ask someone who knows. I listened to the online lectures and read Mozilla documentation, it’s there for a reason. Results? 0 problems during the build process.

Overall, I did not have any problems getting Firefox Minefield 3.1b1pre up and running and the entire process did not take too long. I have a hunch that executing these tasks on Win32 will take longer due to the fact that you have to setup Cygwin and other utilities for VC9 (Visual Studio 2008) in order to get the snowball rolling.

I’m left with one question at the top of my head right now that maybe through comment someone can answer me. If you make a small change in Firefox, do you need to recompile the entire application, or is it modular?

PS: If anyone needs help with building in Ubuntu, send me a shout on IRC.

Cheers,

AaronMT (Aaron).

Posted: September 14th, 2008
Categories: Open Source
Tags:
Comments: 1 Comment.

An interesting article about Mozilla's commitment to Gecko

As an avid reader of ArsTechnica, a site dedicated to providing news and reviews of the tech world, I found an article on the main page discussing Mozilla’s commitment to Gecko as WebKit’s popularity grows. In DPS909 today we touched on this for a brief moment.

Very interesting article – a good read. Although I wont comment on which renderer is better, I’ll let you formulate your own opinion. There really is no solid answer, each has their benefits and flaws.

Anyhow, check it out – as it relates to the course.

- Aaron

Posted: September 12th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Ubiquity Ubiquity Ubiquity

I bet you can’t say that 3 times fast? (I’m already referencing Ubiquity as Ubiq* on IRC )

By now if you haven’t heard about Mozilla’s brand new child-prodigy, self titled Ubiquity, I suggest you download it here.

Ubiquity defined, is the state of being everywhere at once (or seeming to be everywhere at once). That is exactly what this new Mozilla extension offers. This Mozilla extension, is a small application that allows you to quickly perform web-related tasks without having to surf out to different web sites (for instance Ubiquity comes with an assortment of commands for popular websites like: Wikipedia, IMDB, Flickr, and even Twitter). Watch their video for a quick introduction.

Ubiquity allows the user to obtain an assortment of information at a very quick pace without the need to surf around to different websites. In essence, this is on-demand learning and a sense of empowering the user.

One awesome example of Ubiquity’s power is the extreme ease of inserting a common Google Map into the body of an e-mail. I will experiment how what should be a simple task can be performed so convoluted and ridiculous contrasted with how easy it becomes with Ubiquity.

Example 1: A friend’s approach who attends Seneca College in the digital media/art program. Does not know what Ubiquity is but uses Firefox.

  1. Opens Firefox.
  2. Performed a Google Search for “embed Google maps into E-Mail body
  3. Opened first result. Read through it and determined that it was not possible, as suggested on some forum.
  4. Clicked some more results. Still no luck finding an answer.
  5. Gave up and closed Firefox.

Example 2: A friend’s approach who is a student at York University in a non-computer science field. Does not know what Ubiquity is, but uses Firefox.

I can say the approach he took is more technical. I’m surprised at the method he used.

  1. Opens Firefox
  2. Searched for an address in Google Maps.
  3. Print Screen.
  4. Opened MS-Paint, and pasted image, saved the image to hard drive.
  5. Add saved image as an attachment into new email.

Results: It is very interesting to see how this task was performed. I only worked with two friends but the results clearly varied.

Even at such an early alpha, I can see Ubiquity becoming integrated into Firefox in the near future providing the ease of associate common English language into what you want your browser to do.

The task above can be performed so easily by just typing, map of Rogers Centre and clicking the “Insert into map” link. The map is now inserted into your email.

This is the power of Ubiquity and I’m glad that we get to toy with it in this DPS909A lab, perhaps even continue working with it in a semester project. This is going to be a fun to use, great tool.

Although – Security measures will have to be strongly in place since commands may be dangerous. This is one of the first things that came to mind when I first opened up that console window with control-space. Executing user’s self published commands without knowing what they do will be a major problem.

I hope Mozilla is implementing a sandbox around this application, to protect the user’s system and browser from executing malicious commands.

Anyhow,

Fellow class-mates, what do you think of Ubiquity?

Posted: September 10th, 2008
Categories: Open Source
Tags:
Comments: 5 Comments.

"The Great Divide" in open source software

Upon conclusion of Thursday’s lecture in DPS909, I began to ponder the situations in which open source software is perfect, or rather ideal for certain individuals and imperfect and flawed for others. I began to formulate and organize my ideas into my next blog post, to which you are reading this very moment.

To narrow this question down, I began to think with a business context in mind, even reflecting on the past, “Labour Day”. In essence, I believe that there exists a business division deep within open source – a “Great Divide”.

I wanted to know why people are willing to make software for free. Where is the incentive to make software, if you don’t get paid for it? Where is the reward? Give and you shall receive

People need to earn money, and profit incentive is what coerces people to pioneer and create. Money is power. True for many industries, it does not explain why open source software is created. So to look for an answer, I did a little bit of research this morning and organized my findings.

The manifestation of open source software

A birth of open source software arises when there is a need for software to perform a task. A developer creates this from scratch. This developer might have been paid by their employer to create the software, or the work might have been done on spare time. Instead of hoarding the newly created software, the programmer decided to share it with the world by publishing it under an open source license.

The manifestation of an open source community

Somewhere out there in the vastness of the world, it is extremely likely that a second, third or perhaps dozen other developers possess the need for some software that provides the same functionality. Rather than coding up a near duplicate program, the developer unearths the open source project that was recently created. This second developer utilizes the source code to add new features, fix bugs and contribute to the original project. The new developer submits the improvements to the first developer, and the additions and fixes are eventually incorporated into the original project.

Onwards the cycle continues. The project grows and establishes a community of contributors made up of documentation writers, programmers, translators, beta testers, artists, web administrators, and many other important roles.

The manifestation of an open source business

Ubuntu GNU/Linux is a community of thousands – proof that a community of users of such a size can eventually reach a critical mass – a need develops for a commercial entity to provide professional services. A profit motive exists and the commercial open source company is dependent on the success of the open source community.

Future?

As of recently, software companies have been investing in or purchasing open source companies. Perhaps in the near future, your typical style software vendors will actually be developing open source software, and trying to implement a successful business model based on open source.

Just my $.02

Posted: September 6th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

Chrome

Google Chrome

As Homer Simpson might say, “Mmmm chrome” . Anything called “Chrome” just has to be good. Internet king Google has released a new open source browser as of yesterday and I’m excited just to have something new to download. Kudos to Google on the choice of name, Chrome, “What do you mean you don’t have Chrome?”, “My computer has Chrome”, “You have got to get Chrome”.

So what is Chrome? “Chrome is an open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web” – Google

Skeptical at first, I was curious as I have heard not a pin drop behind this project nor its community. Why so secretive? A little searching and I found the developer community, Chromium, the open source project behind Chrome. Their community can be found here.

On to the browser -

Now, I’m a die-hard Firefoxer, so Google will have to do a lot to win me over, but I’m pretty loyal to Google products. Specifically their online products; Google Mail and Calendar. I downloaded it about a half hour ago and already I have a Top 3 list together of what I like about it – essentially to share with you, the reader.

These are my first initial thoughts and things I thought were neat and interesting. This release is an early beta and are subject to change. No.. I wont mention the speed as one of them because speed is relative to many factors besides your browser, it’s still to early to tell.

Google Chrome

Google Chrome

1. Plugins work out of the box:

Currently, Google Chrome supports the most popular plug-ins necessary to display the Web correctly, including Flash, Acrobat Reader, Java, Windows Media Player, Real Player, QuickTime, and Silverlight.” – Google

What? No need to download the latest Adobe/Macromedia plugin, Apple Quicktime? Java? Realplayer? (Who does anyways?)Interesting. Very interesting. Not sure what behind the scenes deal went on here with Google but none-the-less it is cool. No more failed Flash installation problems or troubles invovled with any of the above mentioned plugins. Understandably, some my think this is obtrusive as the plugin may not be desired on ones machine. Mixed opinions on the matter for me. This is great for for those who have no experience with fiddling with installing codecs and other plugins. Perhaps a choice on installation would be better for those who find this sly.

Bonus points: The built-in task manager clearly shows that the flash plugin is a bloated pig. Oops, did I say that.

2. It takes up less screen space: By eliminating the File, Edit, View, etc., from the menu bar from the top of the browser, and the status bar from the bottom, you gain about 150 pixels of valuable viewing space which is great. Browser options are tucked neatly next to the address bar in a wrench icon that you can easily access in the rare occasion when you need to change some settings. Perhaps there exists a keyboard shortcut even. Nice touch. I see some inspiration from Windows Vista’s UI in that the menu bar is hidden by default in Windows Explorer as well as Internet Explorer 7. I guess this is the current movement. Hey, the more real estate the better the experience for browsing the web. Every pixel counts.

3. It will not crash your browser: Oh I can’t wait for the discussions on this. Dave H, In-class perhaps? Chrome will treat each tab as a separate process, so JavaScript runs in the background while you browse. So if you hit a bug, only that tab dies, not your entire browser. You can also open up a mini task manager be able to see which sites are consuming your CPU, just like Windows Task Manager. As of now, I can’t think of any reason not to have modern web browsers do this? Let me know if you think of any.

Have you downloaded Google Chrome? Let me know what you think of it, and post your initial reactions and experience.

Posted: September 4th, 2008
Categories: Open Source
Tags:
Comments: No Comments.

“Those who danced were thought to be quite insane by those who could not hear the music.”

The Cathedal and the Bazaar

Angela Monet once wrote, “Those who danced were thought to be quite insane by those who could not hear the music“. Upon reading and interpreting Eric Raymond’s short reflection of the grand-scale forte of which has become the beautifully bloomed open source software community, I can identity the aspects and key components for which success has been catalyzed from, specifically in the GNU/Linux realm.

The GNU/Linux community is bound by a majestic mesh of fibers that provides the rhythm for the music. Metaphorically speaking, I use the word music to describe an array of unique fibers which, when meshed together, provide the brilliance of grand-scale orchestra. Passion, drive, desire, distribution of knowledge/information and the common goal, provide the synergy needed for such a world wide produced product like GNU/Linux and all its flavors. Understandably, this is one part of a duet that fits into a grand-scale piece; the other being the brilliance of its developers and open transparency/communication with the associated community. In essence it is the yin and the yang, two sides of a coin to perform the perfect rhythm and beat in a song or duet.

What good is a song without rhythm; a song without a beat and a community without passion, drive, a distribution of knowledge and information, and lastly a common goal? These aspects provide the majestic fibres that push a community to success, that build a song, an overture of grand-scale. I say majesic because it is truly magical that people around the world are working globally on a product that is made by the people, for the people. One does not have to look too far; Ubuntu community to see the passion that exists in creating an operating system that everyone can use. As of this writing, the Ubuntu Forums have 884 thousand threads with 655 thousand members each contributing to the community.

I agree with Monet’s quote. Those who dance, may dance all to their desire yet wont have the rhythm and beat if no music is heard.

- Aaron

Posted: September 3rd, 2008
Categories: Open Source
Tags:
Comments: No Comments.

So what is open source software development?

[googlevideo=http://video.google.com/videoplay?docid=7707585592627775409]

Open source software (OSS) refers to software that is developed, tested, or improved through public collaboration and distributed with the idea that the must be shared with others, ensuring an open future collaboration. The collaborative experience of many developers, especially those in the academic environment, in developing various versions of the Unix operating system, Richard Stallman’s idea of Free Software Foundation, and the desire of users to freely choose among a number of products – all of these led to the open source movement and the approach to developing and distributing programs as open source software.

The video posted above, Revolution OS, tells the inside story of the hackers who rebelled against the proprietary software model and Microsoft to create GNU /Linux and the Open Source movement.

Posted: October 4th, 2007
Categories: Open Source
Tags:
Comments: No Comments.

Getting the word out!

Free Software and Open Source Symposium

FSOSS is a few weeks away and and I am trying to get the word out. The symposium is a two-day event aimed at bringing together educators, developers and other interested parties to discuss common free software and open source issues, learn new technologies and to promote the use of free and open source software. At Seneca College, they believe that free and open source software are real alternatives.

The event takes place on:

October 25-26th, 2007 – 9:00 a.m. to 5:00 p.m.
Seneca@York Campus, Toronto

If you are intested in registering, please visit this link.

Posted: October 4th, 2007
Categories: Open Source
Tags:
Comments: No Comments.