OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/web/navigation/crw_session_controller.h" | 5 #import "ios/web/navigation/crw_session_controller.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/strings/sys_string_conversions.h" | 13 #include "base/strings/sys_string_conversions.h" |
15 #import "ios/web/navigation/crw_session_controller+private_constructors.h" | 14 #import "ios/web/navigation/crw_session_controller+private_constructors.h" |
16 #include "ios/web/navigation/crw_session_entry.h" | 15 #include "ios/web/navigation/crw_session_entry.h" |
17 #include "ios/web/navigation/navigation_item_impl.h" | 16 #include "ios/web/navigation/navigation_item_impl.h" |
18 #include "ios/web/public/referrer.h" | 17 #include "ios/web/public/referrer.h" |
19 #include "ios/web/public/test/test_browser_state.h" | 18 #include "ios/web/public/test/test_browser_state.h" |
20 #include "ios/web/public/test/test_web_thread_bundle.h" | 19 #include "ios/web/public/test/test_web_thread_bundle.h" |
21 #import "net/base/mac/url_conversions.h" | 20 #import "net/base/mac/url_conversions.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
23 #include "testing/gtest_mac.h" | 22 #include "testing/gtest_mac.h" |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 | 1025 |
1027 // Remove an entry and attempt to go it. Ensure it outlives the removal. | 1026 // Remove an entry and attempt to go it. Ensure it outlives the removal. |
1028 base::scoped_nsobject<CRWSessionEntry> entry3( | 1027 base::scoped_nsobject<CRWSessionEntry> entry3( |
1029 [[session_controller_.get().entries objectAtIndex:3] retain]); | 1028 [[session_controller_.get().entries objectAtIndex:3] retain]); |
1030 [session_controller_ removeEntryAtIndex:3]; | 1029 [session_controller_ removeEntryAtIndex:3]; |
1031 [session_controller_ goToEntry:entry3]; | 1030 [session_controller_ goToEntry:entry3]; |
1032 EXPECT_EQ(1, session_controller_.get().currentNavigationIndex); | 1031 EXPECT_EQ(1, session_controller_.get().currentNavigationIndex); |
1033 } | 1032 } |
1034 | 1033 |
1035 } // anonymous namespace | 1034 } // anonymous namespace |
OLD | NEW |