| 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/ios/block_types.h" | 10 #include "base/ios/block_types.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 rendererInitiated:YES]; | 236 rendererInitiated:YES]; |
| 237 [tab_ webDidAddPendingURL]; | 237 [tab_ webDidAddPendingURL]; |
| 238 [[[(id)mock_web_controller_ expect] | 238 [[[(id)mock_web_controller_ expect] |
| 239 andReturnValue:OCMOCK_VALUE(kPageLoading)] loadPhase]; | 239 andReturnValue:OCMOCK_VALUE(kPageLoading)] loadPhase]; |
| 240 [[tab_ navigationManager]->GetSessionController() commitPendingEntry]; | 240 [[tab_ navigationManager]->GetSessionController() commitPendingEntry]; |
| 241 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl); | 241 [[tab_ webController] webStateImpl]->OnNavigationCommitted(redirectUrl); |
| 242 [tab_ webDidStartLoadingURL:redirectUrl shouldUpdateHistory:YES]; | 242 [tab_ webDidStartLoadingURL:redirectUrl shouldUpdateHistory:YES]; |
| 243 [tab_ webController:mock_web_controller_ titleDidChange:title]; | 243 [tab_ webController:mock_web_controller_ titleDidChange:title]; |
| 244 [[[(id)mock_web_controller_ expect] | 244 [[[(id)mock_web_controller_ expect] |
| 245 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase]; | 245 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase]; |
| 246 [[tab_ webController] webStateImpl]->OnPageLoaded(redirectUrl, true); | 246 [tab_ webStateImpl]->OnPageLoaded(redirectUrl, true); |
| 247 [tab_ webDidFinishWithURL:redirectUrl loadSuccess:YES]; | |
| 248 } | 247 } |
| 249 | 248 |
| 250 void BrowseToNewTab() { | 249 void BrowseToNewTab() { |
| 251 const GURL url(kNewTabUrl); | 250 const GURL url(kNewTabUrl); |
| 252 // TODO(crbug.com/661992): This will not work with a mock CRWWebController. | 251 // TODO(crbug.com/661992): This will not work with a mock CRWWebController. |
| 253 // The only test that uses it is currently disabled. | 252 // The only test that uses it is currently disabled. |
| 254 web::NavigationManager::WebLoadParams params(url); | 253 web::NavigationManager::WebLoadParams params(url); |
| 255 params.transition_type = ui::PAGE_TRANSITION_TYPED; | 254 params.transition_type = ui::PAGE_TRANSITION_TYPED; |
| 256 [[tab_ webController] loadWithParams:params]; | 255 [[tab_ webController] loadWithParams:params]; |
| 257 [[[(id)mock_web_controller_ expect] | 256 [[[(id)mock_web_controller_ expect] |
| 258 andReturnValue:OCMOCK_VALUE(kPageLoading)] loadPhase]; | 257 andReturnValue:OCMOCK_VALUE(kPageLoading)] loadPhase]; |
| 259 [tab_ webDidStartLoadingURL:url shouldUpdateHistory:YES]; | 258 [tab_ webDidStartLoadingURL:url shouldUpdateHistory:YES]; |
| 260 [[[(id)mock_web_controller_ expect] | 259 [[[(id)mock_web_controller_ expect] |
| 261 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase]; | 260 andReturnValue:OCMOCK_VALUE(kPageLoaded)] loadPhase]; |
| 262 [tab_ webDidFinishWithURL:url loadSuccess:YES]; | 261 [tab_ webStateImpl]->OnPageLoaded(url, true); |
| 263 [tab_ webController:mock_web_controller_ titleDidChange:kNewTabTitle]; | 262 [tab_ webController:mock_web_controller_ titleDidChange:kNewTabTitle]; |
| 264 } | 263 } |
| 265 | 264 |
| 266 void QueryAllHistory(history::QueryResults* results) { | 265 void QueryAllHistory(history::QueryResults* results) { |
| 267 base::CancelableTaskTracker tracker; | 266 base::CancelableTaskTracker tracker; |
| 268 base::RunLoop run_loop; | 267 base::RunLoop run_loop; |
| 269 scoped_refptr<HistoryQueryResultsObserver> observer( | 268 scoped_refptr<HistoryQueryResultsObserver> observer( |
| 270 new HistoryQueryResultsObserver(&run_loop)); | 269 new HistoryQueryResultsObserver(&run_loop)); |
| 271 history_service_->QueryHistory( | 270 history_service_->QueryHistory( |
| 272 base::string16(), history::QueryOptions(), | 271 base::string16(), history::QueryOptions(), |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 EXPECT_FALSE([metadata shouldAutoOpenLinks]); | 549 EXPECT_FALSE([metadata shouldAutoOpenLinks]); |
| 551 } | 550 } |
| 552 | 551 |
| 553 class TestRequestGroupID : public BlockCleanupTest { | 552 class TestRequestGroupID : public BlockCleanupTest { |
| 554 public: | 553 public: |
| 555 void SetUp() override { BlockCleanupTest::SetUp(); } | 554 void SetUp() override { BlockCleanupTest::SetUp(); } |
| 556 void TearDown() override { BlockCleanupTest::TearDown(); } | 555 void TearDown() override { BlockCleanupTest::TearDown(); } |
| 557 }; | 556 }; |
| 558 | 557 |
| 559 } // namespace | 558 } // namespace |
| OLD | NEW |