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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 chrome_browser_state_.get(), ServiceAccessType::EXPLICIT_ACCESS); | 189 chrome_browser_state_.get(), ServiceAccessType::EXPLICIT_ACCESS); |
190 | 190 |
191 ios::ChromeBrowserState* browser_state = chrome_browser_state_.get(); | 191 ios::ChromeBrowserState* browser_state = chrome_browser_state_.get(); |
192 if (UseOffTheRecordBrowserState()) | 192 if (UseOffTheRecordBrowserState()) |
193 browser_state = browser_state->GetOffTheRecordChromeBrowserState(); | 193 browser_state = browser_state->GetOffTheRecordChromeBrowserState(); |
194 | 194 |
195 mock_web_controller_ = | 195 mock_web_controller_ = |
196 [OCMockObject niceMockForClass:[CRWWebController class]]; | 196 [OCMockObject niceMockForClass:[CRWWebController class]]; |
197 auto web_state_impl = base::MakeUnique<WebStateImpl>(browser_state); | 197 auto web_state_impl = base::MakeUnique<WebStateImpl>(browser_state); |
198 web_state_impl->SetWebController(mock_web_controller_); | 198 web_state_impl->SetWebController(mock_web_controller_); |
199 web_state_impl->GetNavigationManagerImpl().InitializeSession(@"window1", | 199 web_state_impl->GetNavigationManagerImpl().InitializeSession(NO); |
200 NO); | |
201 web_state_impl_ = web_state_impl.get(); | 200 web_state_impl_ = web_state_impl.get(); |
202 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] | 201 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] |
203 andReturnValue:OCMOCK_VALUE(web_state_impl_)] webStateImpl]; | 202 andReturnValue:OCMOCK_VALUE(web_state_impl_)] webStateImpl]; |
204 web_controller_view_.reset([[UIView alloc] init]); | 203 web_controller_view_.reset([[UIView alloc] init]); |
205 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] | 204 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] |
206 andReturn:web_controller_view_.get()] view]; | 205 andReturn:web_controller_view_.get()] view]; |
207 tab_.reset([[Tab alloc] initWithWebState:std::move(web_state_impl) | 206 tab_.reset([[Tab alloc] initWithWebState:std::move(web_state_impl) |
208 model:nil | 207 model:nil |
209 attachTabHelpers:NO]); | 208 attachTabHelpers:NO]); |
210 web::NavigationManager::WebLoadParams params(GURL("chrome://version/")); | 209 web::NavigationManager::WebLoadParams params(GURL("chrome://version/")); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 [[FakeNativeAppMetadata alloc] init]); | 551 [[FakeNativeAppMetadata alloc] init]); |
553 | 552 |
554 // Turn auto open on. | 553 // Turn auto open on. |
555 [metadata setShouldAutoOpenLinks:YES]; | 554 [metadata setShouldAutoOpenLinks:YES]; |
556 int expectedCallCount = 2; | 555 int expectedCallCount = 2; |
557 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); | 556 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); |
558 EXPECT_FALSE([metadata shouldAutoOpenLinks]); | 557 EXPECT_FALSE([metadata shouldAutoOpenLinks]); |
559 } | 558 } |
560 | 559 |
561 } // namespace | 560 } // namespace |
OLD | NEW |