1. cd ../mozilla/dist/WIN32_D.OBJ/bin 2. launch testembed.exe (you can interchange steps 3 & 4: same result) 3. Select Tests > Add History Listener 4. Enter a url. 5. Select Tools > Test Your Method; or Interfaces > nsIWebNav and run through nsIWebNavitation::GotoIndex() test. 6. Check TestOutput.txt logfile in C:/Temp folder. Also display prompt. Result: Indicates that nsISHistoryListener::OnHistoryGoBack(). If index for GotoIndex()test is greater than current index, we get nsISHistoryListener::OnHistoryGoForward(). Expected: History listener should call nsISHistoryListener::OnHistoryGotoIndex(). Note: GotoIndex() navigation is working OK. Logfile contents: TestEmbed started up. nsIWebBrowserChrome::SetWebBrowser(). AddWebBrowserListener(). Add History Lstnr test passed. nsIHistoryListener::OnHistoryNewEntry() nsIURI::GetSpec() test passed. the uri = http://www.nokia.com/main.html nsIHistoryListener::OnHistoryGoBack() nsIURI::GetSpec() test passed. the uri = http://www.netscape.com/ OnHistoryGoBack() notification = 1 GotoIndex() test passed. TestEmbed shut down.
onHistoryGotoIndex() is working. Please see the JS testcase that is up in http://bubblegum. I do get callbacks in onHistorygotoIndex().
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → WORKSFORME
Change qa contact to depstein. Reopening this bug after changing the summary to more accurately reflect the problem. nsISHistoryListener::OnHistoryGotoIndex() is called when the difference between the current and the navigated index is greater than 1. So if 3 urls have been loaded, and index = 0 inside goToIndex(), then the listener method will be called; but not when index = 2 or 4. In testEmbed, the goToIndex() is set to 0, so after running the nsIWebNav goForward() test, it will call nsISHistoryListener::OnHistoryGoBack().
Status: RESOLVED → REOPENED
QA Contact: mdunn → depstein
Resolution: WORKSFORME → ---
Summary: nsISHistoryListener::OnHistoryGotoIndex() isn't called for GotoIndex() → nsISHistoryListener::OnHistoryGotoIndex() isn't called when the abs(current index - goToIndex) <= 1
Status: REOPENED → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.5
Comment on attachment 49235 [details] [diff] [review] patch to nsSHistory.cpp sr=alecf
Attachment #49235 - Flags: superreview+
Fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago → 18 years ago
Resolution: --- → FIXED
nsISHistoryListener::OnHistoryGotoIndex()is called, but the index of the last url is always passed to it, not the true value from GoToIndex(). So if we load 3 urls, and the index is set to 0, it still passes 2 to OnHistoryGotoIndex(). I'll verify this one as fixed and will investigate this other one.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.