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

Side by Side Diff: ios/chrome/browser/tabs/tab_unittest.mm

Issue 2672723003: Converted CRWSessionController to use NavigationItems. (Closed)
Patch Set: test fixes, self review Created 3 years, 10 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/chrome/browser/tabs/tab_model_unittest.mm ('k') | ios/web/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <UIKit/UIKit.h> 5 #import <UIKit/UIKit.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 232
233 void BrowseTo(const GURL& userUrl, const GURL& redirectUrl, NSString* title) { 233 void BrowseTo(const GURL& userUrl, const GURL& redirectUrl, NSString* title) {
234 DCHECK_EQ(tab_.get().webState, web_state_impl_); 234 DCHECK_EQ(tab_.get().webState, web_state_impl_);
235 web::Referrer empty_referrer; 235 web::Referrer empty_referrer;
236 [tab_ webWillAddPendingURL:userUrl transition:ui::PAGE_TRANSITION_TYPED]; 236 [tab_ webWillAddPendingURL:userUrl transition:ui::PAGE_TRANSITION_TYPED];
237 web_state_impl_->OnProvisionalNavigationStarted(userUrl); 237 web_state_impl_->OnProvisionalNavigationStarted(userUrl);
238 [tab_ webWillAddPendingURL:redirectUrl 238 [tab_ webWillAddPendingURL:redirectUrl
239 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT]; 239 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT];
240 [[tab_ navigationManager]->GetSessionController() 240 [[tab_ navigationManager]->GetSessionController()
241 addPendingEntry:redirectUrl 241 addPendingItem:redirectUrl
242 referrer:empty_referrer 242 referrer:empty_referrer
243 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT 243 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT
244 rendererInitiated:YES]; 244 rendererInitiated:YES];
245 web_state_impl_->OnProvisionalNavigationStarted(redirectUrl); 245 web_state_impl_->OnProvisionalNavigationStarted(redirectUrl);
246 [[tab_ navigationManager]->GetSessionController() commitPendingEntry]; 246 [[tab_ navigationManager]->GetSessionController() commitPendingItem];
247 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl); 247 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl);
248 [tab_ webDidStartLoadingURL:redirectUrl shouldUpdateHistory:YES]; 248 [tab_ webDidStartLoadingURL:redirectUrl shouldUpdateHistory:YES];
249 [tab_ webController:mock_web_controller_ titleDidChange:title]; 249 [tab_ webController:mock_web_controller_ titleDidChange:title];
250 [[[(id)mock_web_controller_ expect] 250 [[[(id)mock_web_controller_ expect]
251 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase]; 251 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase];
252 web_state_impl_->OnPageLoaded(redirectUrl, true); 252 web_state_impl_->OnPageLoaded(redirectUrl, true);
253 } 253 }
254 254
255 void BrowseToNewTab() { 255 void BrowseToNewTab() {
256 DCHECK_EQ(tab_.get().webState, web_state_impl_); 256 DCHECK_EQ(tab_.get().webState, web_state_impl_);
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 [[FakeNativeAppMetadata alloc] init]); 551 [[FakeNativeAppMetadata alloc] init]);
552 552
553 // Turn auto open on. 553 // Turn auto open on.
554 [metadata setShouldAutoOpenLinks:YES]; 554 [metadata setShouldAutoOpenLinks:YES];
555 int expectedCallCount = 2; 555 int expectedCallCount = 2;
556 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); 556 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO);
557 EXPECT_FALSE([metadata shouldAutoOpenLinks]); 557 EXPECT_FALSE([metadata shouldAutoOpenLinks]);
558 } 558 }
559 559
560 } // namespace 560 } // namespace
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab_model_unittest.mm ('k') | ios/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698