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/strings/sys_string_conversions.h" | 13 #include "base/strings/sys_string_conversions.h" |
14 #import "ios/web/navigation/crw_session_controller+private_constructors.h" | 14 #import "ios/web/navigation/crw_session_controller+private_constructors.h" |
15 #include "ios/web/navigation/crw_session_entry.h" | 15 #import "ios/web/navigation/crw_session_entry.h" |
16 #include "ios/web/navigation/navigation_item_impl.h" | 16 #import "ios/web/navigation/navigation_item_impl.h" |
17 #include "ios/web/public/referrer.h" | 17 #include "ios/web/public/referrer.h" |
18 #include "ios/web/public/test/test_browser_state.h" | 18 #include "ios/web/public/test/test_browser_state.h" |
19 #include "ios/web/public/test/test_web_thread_bundle.h" | 19 #include "ios/web/public/test/test_web_thread_bundle.h" |
20 #import "net/base/mac/url_conversions.h" | 20 #import "net/base/mac/url_conversions.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "testing/gtest_mac.h" | 22 #import "testing/gtest_mac.h" |
23 #include "testing/platform_test.h" | 23 #include "testing/platform_test.h" |
24 | 24 |
25 @interface CRWSessionController (Testing) | 25 @interface CRWSessionController (Testing) |
26 - (const GURL&)URLForSessionAtIndex:(NSUInteger)index; | 26 - (const GURL&)URLForSessionAtIndex:(NSUInteger)index; |
27 - (const GURL&)currentURL; | 27 - (const GURL&)currentURL; |
28 @end | 28 @end |
29 | 29 |
30 @implementation CRWSessionController (Testing) | 30 @implementation CRWSessionController (Testing) |
31 - (const GURL&)URLForSessionAtIndex:(NSUInteger)index { | 31 - (const GURL&)URLForSessionAtIndex:(NSUInteger)index { |
32 CRWSessionEntry* entry = | 32 CRWSessionEntry* entry = |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 [session_controller_ commitPendingEntry]; | 1120 [session_controller_ commitPendingEntry]; |
1121 [session_controller_ addPendingEntry:GURL("http://www.example.com/0") | 1121 [session_controller_ addPendingEntry:GURL("http://www.example.com/0") |
1122 referrer:MakeReferrer("http://www.example.com/b") | 1122 referrer:MakeReferrer("http://www.example.com/b") |
1123 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT | 1123 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT |
1124 rendererInitiated:YES]; | 1124 rendererInitiated:YES]; |
1125 [session_controller_ commitPendingEntry]; | 1125 [session_controller_ commitPendingEntry]; |
1126 EXPECT_EQ(0U, [session_controller_ backwardEntries].count); | 1126 EXPECT_EQ(0U, [session_controller_ backwardEntries].count); |
1127 } | 1127 } |
1128 | 1128 |
1129 } // anonymous namespace | 1129 } // anonymous namespace |
OLD | NEW |