Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: chrome/browser/back_forward_menu_model_unittest.cc

Issue 479: DidNavigate refactor of doom (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | chrome/browser/navigation_controller.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/back_forward_menu_model_unittest.cc
===================================================================
--- chrome/browser/back_forward_menu_model_unittest.cc (revision 1840)
+++ chrome/browser/back_forward_menu_model_unittest.cc (working copy)
@@ -29,30 +29,20 @@
BackFwdMenuModelTestTabContents() : TabContents(kHTTPTabContentsType) {
}
- bool Navigate(const NavigationEntry& entry, bool reload) {
- NavigationEntry* pending_entry = new NavigationEntry(entry);
- if (pending_entry->page_id() == -1) {
- pending_entry->set_page_id(g_page_id_++);
- }
- NavigationController::LoadCommittedDetails details;
- DidNavigateToEntry(pending_entry, &details);
+ // We do the same thing as the TabContents one (just commit the navigation)
+ // but we *don't* want to reset the title since the test looks for this.
+ virtual bool NavigateToPendingEntry(bool reload) {
+ controller()->CommitPendingEntry();
return true;
}
void UpdateState(const std::wstring& title) {
NavigationEntry* entry =
- controller()->GetEntryWithPageID(type(), NULL, g_page_id_ - 1);
+ controller()->GetEntryWithPageID(type(), NULL, GetMaxPageID());
entry->set_title(title);
}
-
- private:
- // We need to use valid, incrementing page ids otherwise the TabContents
- // and NavController will not play nice when we try to go back and forward.
- static int g_page_id_;
};
-int BackFwdMenuModelTestTabContents::g_page_id_ = 0;
-
// This constructs our fake TabContents.
class BackFwdMenuModelTestTabContentsFactory : public TabContentsFactory {
public:
« no previous file with comments | « no previous file | chrome/browser/dom_ui/new_tab_ui.cc » ('j') | chrome/browser/navigation_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698