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

Unified Diff: ios/web/public/test/fakes/test_navigation_manager.mm

Issue 2915303002: Added NavigationManager::GetIndexOfItem(). (Closed)
Patch Set: Created 3 years, 7 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
Index: ios/web/public/test/fakes/test_navigation_manager.mm
diff --git a/ios/web/public/test/fakes/test_navigation_manager.mm b/ios/web/public/test/fakes/test_navigation_manager.mm
index 972efdcac3ce063fbf2893d2ae9e8bc60fb1007a..b7e4dbeacdc028e5dae3eea8129c29837454c8cf 100644
--- a/ios/web/public/test/fakes/test_navigation_manager.mm
+++ b/ios/web/public/test/fakes/test_navigation_manager.mm
@@ -75,6 +75,15 @@
return items_[index].get();
}
+int TestNavigationManager::GetIndexOfItem(
+ const web::NavigationItem* item) const {
+ for (size_t index = 0; index < items_.size(); ++index) {
+ if (items_[index].get() == item)
+ return index;
+ }
+ return NSNotFound;
Eugene But (OOO till 7-30) 2017/06/02 18:08:08 s/NSNotFound/-1
kkhorimoto 2017/06/02 18:28:58 Done.
+}
+
void TestNavigationManager::SetLastCommittedItemIndex(const int index) {
DCHECK(index == -1 || index >= 0 && index < GetItemCount());
items_index_ = index;

Powered by Google App Engine
This is Rietveld 408576698