| 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 <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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT]; | 235 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT]; |
| 236 [[tab_ navigationManager]->GetSessionController() | 236 [[tab_ navigationManager]->GetSessionController() |
| 237 addPendingEntry:redirectUrl | 237 addPendingEntry:redirectUrl |
| 238 referrer:empty_referrer | 238 referrer:empty_referrer |
| 239 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT | 239 transition:ui::PAGE_TRANSITION_CLIENT_REDIRECT |
| 240 rendererInitiated:YES]; | 240 rendererInitiated:YES]; |
| 241 [tab_ webStateImpl]->OnProvisionalNavigationStarted(redirectUrl); | 241 [tab_ webStateImpl]->OnProvisionalNavigationStarted(redirectUrl); |
| 242 [[tab_ navigationManager]->GetSessionController() commitPendingEntry]; | 242 [[tab_ navigationManager]->GetSessionController() commitPendingEntry]; |
| 243 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl); | 243 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl); |
| 244 [tab_ webDidStartLoadingURL:redirectUrl shouldUpdateHistory:YES]; | 244 [tab_ webDidStartLoadingURL:redirectUrl shouldUpdateHistory:YES]; |
| 245 base::string16 new_title = base::SysNSStringToUTF16(title); |
| 246 [tab_ navigationManager]->GetLastCommittedItem()->SetTitle(new_title); |
| 245 [tab_ webController:mock_web_controller_ titleDidChange:title]; | 247 [tab_ webController:mock_web_controller_ titleDidChange:title]; |
| 246 [[[(id)mock_web_controller_ expect] | 248 [[[(id)mock_web_controller_ expect] |
| 247 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase]; | 249 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase]; |
| 248 [tab_ webStateImpl]->OnPageLoaded(redirectUrl, true); | 250 [tab_ webStateImpl]->OnPageLoaded(redirectUrl, true); |
| 249 } | 251 } |
| 250 | 252 |
| 251 void BrowseToNewTab() { | 253 void BrowseToNewTab() { |
| 252 const GURL url(kNewTabUrl); | 254 const GURL url(kNewTabUrl); |
| 253 // TODO(crbug.com/661992): This will not work with a mock CRWWebController. | 255 // TODO(crbug.com/661992): This will not work with a mock CRWWebController. |
| 254 // The only test that uses it is currently disabled. | 256 // The only test that uses it is currently disabled. |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 [[FakeNativeAppMetadata alloc] init]); | 547 [[FakeNativeAppMetadata alloc] init]); |
| 546 | 548 |
| 547 // Turn auto open on. | 549 // Turn auto open on. |
| 548 [metadata setShouldAutoOpenLinks:YES]; | 550 [metadata setShouldAutoOpenLinks:YES]; |
| 549 int expectedCallCount = 2; | 551 int expectedCallCount = 2; |
| 550 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); | 552 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); |
| 551 EXPECT_FALSE([metadata shouldAutoOpenLinks]); | 553 EXPECT_FALSE([metadata shouldAutoOpenLinks]); |
| 552 } | 554 } |
| 553 | 555 |
| 554 } // namespace | 556 } // namespace |
| OLD | NEW |