1. Make sure that session history listener has been added in the test framework. In mfcEmbed, I added: nsWeakPtr weakling( dont_AddRef(NS_GetWeakReference(NS_STATIC_CAST(nsISHistoryListener*, mBrowserImpl)))); rv = qaWebBrowser->AddWebBrowserListener(weakling, NS_GET_IID(nsISHistoryListener)); 2. Enter at least one url to create a session history. 3. Purge session history. In mfcEmbed: nsCOMPtr<nsISHistory> theSessionHistory; mWebNav->GetSessionHistory( getter_AddRefs(theSessionHistory)); rv = theSessionHistory->GetCount(&numEntries); rv = theSessionHistory->PurgeHistory(numEntries); 4. Notice that the back and forward buttons are disabled. That's fine at this point. Now, enter another url. Result: The session history events are disabled (forward, back, reload, etc.) Expected: Since we've entered a url, they should be enabled. Note: They get enabled after entering the Second url.
I will look in to this.I think I have a clue on what the problem is.
changing qa contact to depstein
Myself and depstein talked about it. THis is due to the way pages are added to SH. Fixing this will bring up another bug. I think it is not a serious flaw in the way PurgeHistory works.