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

Side by Side Diff: ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm

Issue 2842443002: Create NavigationContext right after the navigation was started. (Closed)
Patch Set: Fixed tests 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 unified diff | Download patch
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698