Open main menu

CDOT Wiki β

Contribute to Private Browsing Tests

Revision as of 10:53, 21 October 2008 by AaronMT (talk | contribs) (Session Store Unit Test Notes)

Private Browsing Tests

An Introduction

Background history

"The purpose of private browsing is to put Firefox into a temporary state where no information about the user's browsing session is stored locally. Firefox currently handles the user's privacy with a feature in preferences to clear all private data. This feature forces the user to choose between having privacy (even if only momentary), and other useful features like browsing history, and saved passwords. Users should be able to go "off the record", they shouldn't have to shoot the reporter. " wiki.mozilla.org/PrivateBrowsing

Preliminary Mockup:
   

The Project Offered

The new Private Browsing feature (see bug 248970 and the test plan) needs thorough tests written in order to insure its proper functionality. This will involve collaborating with those writing the patch and tests in order to develop a full suite of tests. Resources: ehsan, discussion of Private Browsing

  • Helpful Contacts:
    • Ehsan Akhgari
      • E-Mail: (ehsan dot akhgari at gmail dot com)
    • Marcia Knous (QA)
      • E-Mail: (marcia at mozilla dot org)
    • Clint Talbert (QA Dev Engineer)
      • E-Mail: (ctalbert at mozilla dot com)
      • IRC: ctalbert

Project Description

  • Milestone 0.1 will contain the History component unit test.
  • Milestone 0.2 will contain the Session Store component unit test.

Note: Some areas already covered by Ehsan and others working on Bug #248970.

Private Browsing Test Plan

Private Browsing Unit Tests

Project Milestone Information

  • For the first milestone phase, I plan to have complete
  • For the second milestone phase, I plan to have complete

What to expect for 0.1 release?

  • I plan to have a unit test complete for the testing area involved with places and history. This will be submitted to Ehsan as well.
    • Places unit test reviewed by Ehsan
    • Blogged about it
    • Post unit test
    • Screenshots
    • Submit deliverables

Visual Representation of Places testing area -> my blog

What to expect for 0.2 release?

  • I plan to have a unit test complete for the testing area involved with session storage. This will be submitted to Ehsan as well.

Project Deliverables

Milestone 0.1

History Unit Test - Complete

Private Browsing Testing Area Private Browsing Unit Test (My Work)
History/Places/Bookmarks Unit Test test_248970_history.js


Visual Representation of Places testing area -> My Blog - Click Here

 


E-Mail Conversations with Ehsan (Example) http://matrix.senecac.on.ca/~amtrain/other/email.jpg

What I learned?

  • 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/Dependancy Bugs -
    • Patches - How to apply the following patches: #248970, #457110, and #458954.
    • Building - Clean builds with fresh applied patches

Community Interaction

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.

Quick Project Notes

  • To run browser chrome tests:
    • /obj-i686-pc-linux-gnu/_tests/testing/mochitest$ python runtests.py --browser-chrome
  • To work on the session store area, I believe I'll need to work with browser chrome tests
  • Session Store unit-tests are stored in
/browser/components/sessionstore/test/browser/
  • Places unit-tests are stored in
toolkit/components/places/tests/unit
  • To run a single unit-test use check-one SOLO_FILE
    • Example
make SOLO_FILE=test_bug248970.js -C objdir/netwerk/test check-one

Project Leader(s)

Project Contributor(s)

Area's where you could contribute to my project

  • (A) You have written an extension before
    • Testing is needed on the private browsing service. If you have written an extension in the past or are going to, it would sweet if you also test the new API found here - Let me know if API calls are working, nothing fancy has to be done, just has to work properly. Send me feedback and I can pass this on back to Mozilla Devs.
  • (B) You have not written an extension before
    • It would be very helpful if you could test out the new private browsing feature, specifically testing out the history component of it.

Should you select (B)

  • Make sure you have an updated trunk build of Mozilla Firefox.
  • Download the newest patch off Bug #248970 which would make you manly, or download the latest try server build right here
  • Install the patch, refer to week 4 lab.
  • Build Firefox.
  • Open Firefox.
  • Follow this test plan:
    • Visit a bunch of websites, ranging from anything in particular.
    • Create a bookmark from one of the sites.
    • Enter private browsing mode Tools -> Private Browsing Mode with a new session.
    • Open your history and visit the same sites, the visit count should not increase (this is visible in History -> Show All History, add the new column).
    • Check if your bookmark has been visited, it should not.
    • Visit new web sites, they should not be added to your history list.
    • Add a bookmark from a new website.
    • Exit private browsing mode.
    • Both bookmarks should still be accessible.
    • Visit the sites in your history again, the visit count should now increase (History -> Show All History).
  • If everything follows according to plan, let me know and I can add your name as a contributor.
  • If there is a problem let me know, I will add your name as a contributor and forward the problem to the Bug #248970.


Please post your test results here for your path of testing

(A) - Results

Date IRC Nick Platform Private Browsing API function called Did it work?


(B) - Results

Date IRC Nick Platform Private Browsing Patch Version Expected Results for history and bookmarks? (Comments) Other issues
14-Oct-2008 AaronMT Windows Vista Business 32-bit i386 v2.13 (191.93 KB, patch) No problems.
14-Oct-2008 ezadkiel Mac OSX 10.4.11 32-bit i386 Mac-try-server-build No problems Clicked private browsing > Save and Close My Session upon exit Private Browsing Minefield crashes Mac OSX 10.4.11 when it tries to load back the previous session with multiple tabs)
20-Oct-2008 JesseV Windows XP Pro SP2 Patch (v2.15) (127.33 KB, patch) No problems

Project Details

Bugs associated with Bug #248970

  • Depends On
    • Bug #460608 - Download of temporary files for helper applications are stored in downloads.sqlite while private browsing is active
    • Bug #460609 - (Temporary files for helper applications are not deleted when leaving Private Browsing mode
  • Blocker
    • Bug #454792 - Should safe browsing code react to private browsing mode?
    • Bug #456884 - Provide a way to open a link into private browsing mode
    • Bug #460346 - Privacy pref for "Always on" Private Browsing Mode
    • Bug #411929 - Private Browsing UI

Session Store Unit Test Notes

  • Test to determine the current window's closed tab count
browser_248970 - getClosedTabCount(window)
   let count = ss.getClosedTabCount(window);
   let max_tabs_undo = gPrefService.getIntPref("browser.sessionstore.max_tabs_undo");
   ok(0 <= count && count <= max_tabs_undo,"getClosedTabCount returns zero or at most max_tabs_undo");
   
  • Setting up a state for a tab
   // setup a state for a tab
   let key1 = "key";
   let value1 = "Value " + Math.random();
   let state1 = { entries: [{ url: testURL }], extData: { key: value1 } };
   

History Unit Test Notes

  • AaronMT 20:06, 5 October 2008 (UTC)
    • Function performs a query on items Places items
test_248970_history - check_placesItemCount()
/**
 * Function performs a really simple query on our places entries,
 * and makes sure that the number of entries equal num_places_entries.
 *
 * @returns nothing
 */
function check_placesItem_Count(){
  var options = histsvc.getNewQueryOptions();
  options.includeHidden = true;
  var query = histsvc.getNewQuery();
  var result = histsvc.executeQuery(query, options);
  var root = result.root;
  root.containerOpen = true;
  var cc = root.childCount;
  do_check_true(cc==num_places_entries);
  root.containerOpen = false;
}
  • AaronMT 00:41, 27 September 2008 (UTC)
    • Using a Mozilla function that checks to see if a URI exists in a database.
test_248970_history - uri_in_DB(URI)
/**
 * Checks to see that a URI is in the database.
 *
 * @param aURI
 *        The URI to check.
 * @returns true if the URI is in the DB, false otherwise.
 */
function uri_in_db(aURI) {
  var options = histsvc.getNewQueryOptions();
  options.maxResults = 1;
  options.resultType = options.RESULTS_AS_URI
  var query = histsvc.getNewQuery();
  query.uri = aURI;
  var result = histsvc.executeQuery(query, options);
  var root = result.root;
  root.containerOpen = true;
  return (root.childCount == 1);
}
  • AaronMT 23:45, 26 September 2008 (UTC)
    • Wrote a new function that creates a handful of history items with various visit types.
test_248970_history - fill_history()
var dayLabels = 
[ 
  "Today", 
  "Yesterday", 
  "2 days ago", 
  "3 days ago",
  "4 days ago",
  "5 days ago",
  "6 days ago",
  "Older than 6 days"
];
/**
 * Function fills history and checks if date labels
 * are correct for partially filled history
 *
 * @returns nothing
 */
function fill_history() {
  const checkOlderOffset = 4;

  // add visits for the older days
  for (var i=checkOlderOffset; i<dayLabels.length; i++)
  {
    var testURI = uri("http://mirror"+i+".mozilla.com/b");
    add_visit(testURI, -i);
    var testURI = uri("https://mirror"+i+".mozilla.com/a");
    add_visit(testURI, -i);
    var testURI = uri("ftp://mirror"+i+".google.com/b");
    add_visit(testURI, -i);
    var testURI = uri("http://mirror"+i+".google.com/a");
    add_visit(testURI, -i);
  }
}

Project Weekly TODO

My Weekly TODO for October
  • Week of October 20th
    • Work & completion of second testing area, session store & browsing tests - submission for review
  • Week of October 15th
    • Submission of first testing area, research into second testing area. Produce a working clean build with all the necessary patches depending on #248970
  • Week of October 6th,
    • Goal is to have my places unit test reviewed by Ehsan, ready to go and onwards to the next area of testing.
    • Oct 10th, still waiting for feedback from Ehsan, he mentioned to just continue on. Will do.
  • Week of Sept 29th
    • Goal is to have a unit test available for History Testing Area by the end of the week
      • The testing plan criteria may be found here: click here
  • Week of Sept 22nd - (Script available here: test_historySimple.js)
    • Goal is to write a simple XPCShell unit test that taps into an XPCOM service that
      • (a) Creates a history entry.
      • (b) Checks to see if history entry exists.
  • Week of Sept 15th
    • What the scope of the project is?
    • What tools/environment will be needed (Windows/Ubuntu)?
    • What scope limitations can be handled for first iteration (0.1)?
    • IRC Channels related to project and or other involved members?

Project News

October

News Items
  • AaronMT 15:40, 21 October 2008 (UTC)
    • Unit Test for Session Store and Browsing Tests for private browsing mode near complete.
    • Submission for review shortly.
  • AaronMT 18:13, 16 October 2008 (UTC)
    • Clean build with patch 2.13 , ready for working with the session store
  • AaronMT 23:13, 14 October 2008 (UTC)
    • Attempting to produce a clean build with private browsing patch 2.13 (lots of changes with download manager and session store)
  • AaronMT 23:22, 10 October 2008 (UTC)
  • AaronMT 04:44, 4 October 2008 (UTC)
    • Completed the places unit test.
      • Submitted to Ehsan @ Mozilla for review
  • AaronMT 20:15, 5 October 2008 (UTC)
    • Awaiting review from Ehsan

September

News Items
  • AaronMT 21:06, 29 September 2008 (UTC)
    • Spoke with Ehsan over email about nsINavHistoryService object querying using higher level API over lower level SQL.
    • Wrote function that compares a bookmark's visit count during private browsing mode. Being analyzed by Ehsan.
  • AaronMT 23:35, 25 September 2008 (UTC)
    • New patch released, downloaded and spoke with Ehsan on IRC over properly installing new patch as well as what test plans I can write
  • AaronMT 03:43, 24 September 2008 (UTC)
    • Wrote a simple unit test script that integrates the nsiBrowserHistory service from XPConnect that creates a history manager, inserts an entry, and checks if it was properly inserted. In essence, this acts as a simple example of writing a unit test.
  • AaronMT 16:52, 21 September 2008 (UTC)
    • Researching how the directory structure of unit tests are inside a Mozilla Build / E-Mailed Ehsan
  • AaronMT 00:19, 21 September 2008 (UTC)
    • Conversed with Ehsan through E-Mail, asked some questions regarding XPCShell tests and 'How tests are submitted'.
  • AaronMT 02:08, 19 September 2008 (UTC)
    • Introduced myself to Bug 248970, hope I get some feedback.
    • Found an excellent example of a unit test written by Ehsan (Mozilla)
  • AaronMT 02:09, 18 September 2008 (UTC)
    • Met Mardeg, was introduced to Build:TryServer, and the MozillaTry tree of Tinderbox
  • AaronMT 23:50, 16 September 2008 (UTC)
    • Met and talked briefly with Clint Talbert (ctalbert) (QA Dev Engineer)
  • AaronMT 18:30, 15 September 2008 (UTC)
    • Selected a project & created project profile page.

External Links

Non-Related to project

Other