Difference between revisions of "Dive into Mozilla Fixing a Bug Lab"

From CDOT Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
[[Dive into Mozilla]] > [[Dive into Mozilla Day 4]] > Fixing a Bug Lab
  
 +
== Overview ==
  
Deleting first item in History Sidebar causes no item have focus.
+
This lab is designed to give you first-hand experience trying to fix a JavaScript bug in the browser.  You will work on an existing bug that has already been solved.  This will allow you to compare your work to that of the fix.
  
Deleting any other item sets focus on the next item after the deleted one (and
+
== Instructions ==
that is correct).
 
  
Reproducible: Always
+
* Read the description of the following bug, and make sure you can reproduce the behaviour in your browser.  '''Use Firefox 2 and not your trunk build to test, since trunk has it fixed''':
  
Steps to Reproduce:
+
Deleting first item in History Sidebar causes no item have focus.
1. Open history sidebar
+
2. Sort items by date
+
Deleting any other item sets focus on the next item after the deleted one (and that is correct).
3. Delete category Today (which is certainly the first one)
+
 +
Reproducible: Always
 +
 +
Steps to Reproduce:
 +
1. Open history sidebar
 +
2. Sort items by date
 +
3. Delete category Today (which is certainly the first one)
 +
 +
You can alternatively use history search and delete fist item found.
 +
 +
Actual Results: 
 +
None of items or categories have focus.
 +
 +
Expected Results: 
 +
Focus should be set on the next item after deleted one.
  
You can alternatively use history search and delete fist item found.
+
* Since the bug has already been fixed, we need to roll-back to an earlier version of the file from CVS.  ''NOTE: at the time of writing (February 28, 2007), the most recent version of nsTreeController.js was 1.5, and we need 1.4'':
  
Actual Results:   
+
$ cd mozilla/toolkit/obsolete/content
None of items or categories have focus.
+
$ cvs update -j1.5 -j1.4 nsTreeController.js
 +
RCS file: /cvsroot/mozilla/toolkit/obsolete/content/nsTreeController.js,v
 +
retrieving revision 1.5
 +
  retrieving revision 1.4
 +
Merging differences between 1.5 and 1.4 into nsTreeController.js
  
Expected Results: 
+
* Using the debugging tools and techniques we learned earlier, see if you can isolate and fix this bug in nsTreeController.js.
Focus should be set on the next item after deleted one.
 
  
 +
'''Try to avoid the temptation to look at the patch until you have finished!'''
  
 
+
== Resources ==
 
+
* [http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/toolkit/obsolete/content/nsTreeController.js&rev=HEAD&mark=1.5 Bonsai, showing the checked-in patch (1.5)]
Bug
+
* [https://bugzilla.mozilla.org/show_bug.cgi?id=318532 Bug 318532]
https://bugzilla.mozilla.org/show_bug.cgi?id=318532
 
 
 
Need to roll-back the changes
 
$ cd mozilla/toolkit/obsolete/content
 
cvs update -j1.5 -j1.4 nsTreeController.js
 
 
 
Bonsai
 
http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/toolkit/obsolete/content/nsTreeController.js&rev=HEAD&mark=1.5
 

Revision as of 18:50, 28 February 2007

Dive into Mozilla > Dive into Mozilla Day 4 > Fixing a Bug Lab

Overview

This lab is designed to give you first-hand experience trying to fix a JavaScript bug in the browser. You will work on an existing bug that has already been solved. This will allow you to compare your work to that of the fix.

Instructions

  • Read the description of the following bug, and make sure you can reproduce the behaviour in your browser. Use Firefox 2 and not your trunk build to test, since trunk has it fixed:
Deleting first item in History Sidebar causes no item have focus.

Deleting any other item sets focus on the next item after the deleted one (and that is correct).

Reproducible: Always

Steps to Reproduce:
1. Open history sidebar
2. Sort items by date
3. Delete category Today (which is certainly the first one)

You can alternatively use history search and delete fist item found.

Actual Results:  
None of items or categories have focus.

Expected Results:  
Focus should be set on the next item after deleted one.
  • Since the bug has already been fixed, we need to roll-back to an earlier version of the file from CVS. NOTE: at the time of writing (February 28, 2007), the most recent version of nsTreeController.js was 1.5, and we need 1.4:
$ cd mozilla/toolkit/obsolete/content
$ cvs update -j1.5 -j1.4 nsTreeController.js 
RCS file: /cvsroot/mozilla/toolkit/obsolete/content/nsTreeController.js,v
retrieving revision 1.5
retrieving revision 1.4
Merging differences between 1.5 and 1.4 into nsTreeController.js
  • Using the debugging tools and techniques we learned earlier, see if you can isolate and fix this bug in nsTreeController.js.

Try to avoid the temptation to look at the patch until you have finished!

Resources