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

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

Issue 2619383002: [ios] Removed webDidFinishWithURL:loadSuccess: from CRWWebDelegate. (Closed)
Patch Set: Updated pragma mark Created 3 years, 11 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.mm ('k') | ios/web/public/web_state/ui/crw_web_delegate.h » ('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/ios/block_types.h" 10 #include "base/ios/block_types.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698