| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/web_state/ui/crw_wk_navigation_states.h" | 5 #import "ios/web/web_state/ui/crw_wk_navigation_states.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #include "ios/web/web_state/navigation_context_impl.h" | 10 #include "ios/web/web_state/navigation_context_impl.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // navigation_1 is the only navigation and it is the latest. | 115 // navigation_1 is the only navigation and it is the latest. |
| 116 [states_ setState:WKNavigationState::REQUESTED forNavigation:navigation1_]; | 116 [states_ setState:WKNavigationState::REQUESTED forNavigation:navigation1_]; |
| 117 ASSERT_EQ(navigation1_, [states_ lastAddedNavigation]); | 117 ASSERT_EQ(navigation1_, [states_ lastAddedNavigation]); |
| 118 EXPECT_EQ(WKNavigationState::REQUESTED, [states_ lastAddedNavigationState]); | 118 EXPECT_EQ(WKNavigationState::REQUESTED, [states_ lastAddedNavigationState]); |
| 119 | 119 |
| 120 // null navigation is added later and hence the latest. | 120 // null navigation is added later and hence the latest. |
| 121 [states_ setState:WKNavigationState::STARTED forNavigation:nil]; | 121 [states_ setState:WKNavigationState::STARTED forNavigation:nil]; |
| 122 EXPECT_FALSE([states_ lastAddedNavigation]); | 122 EXPECT_FALSE([states_ lastAddedNavigation]); |
| 123 EXPECT_EQ(WKNavigationState::STARTED, [states_ lastAddedNavigationState]); | 123 EXPECT_EQ(WKNavigationState::STARTED, [states_ lastAddedNavigationState]); |
| 124 | 124 |
| 125 // navigation_1 is the is the latest again after removing null navigation. | 125 // navigation_1 is the latest again after removing null navigation. |
| 126 [states_ removeNavigation:nil]; | 126 [states_ removeNavigation:nil]; |
| 127 ASSERT_EQ(navigation1_, [states_ lastAddedNavigation]); | 127 ASSERT_EQ(navigation1_, [states_ lastAddedNavigation]); |
| 128 EXPECT_EQ(WKNavigationState::REQUESTED, [states_ lastAddedNavigationState]); | 128 EXPECT_EQ(WKNavigationState::REQUESTED, [states_ lastAddedNavigationState]); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace web | 131 } // namespace web |
| OLD | NEW |