| 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( | 199 web_state_impl->GetNavigationManagerImpl().InitializeSession(@"window1", |
| 200 @"window1", @"opener", NO, 0); | 200 NO); |
| 201 web_state_impl_ = web_state_impl.get(); | 201 web_state_impl_ = web_state_impl.get(); |
| 202 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] | 202 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] |
| 203 andReturnValue:OCMOCK_VALUE(web_state_impl_)] webStateImpl]; | 203 andReturnValue:OCMOCK_VALUE(web_state_impl_)] webStateImpl]; |
| 204 web_controller_view_.reset([[UIView alloc] init]); | 204 web_controller_view_.reset([[UIView alloc] init]); |
| 205 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] | 205 [[[static_cast<OCMockObject*>(mock_web_controller_) stub] |
| 206 andReturn:web_controller_view_.get()] view]; | 206 andReturn:web_controller_view_.get()] view]; |
| 207 tab_.reset([[Tab alloc] initWithWebState:std::move(web_state_impl) | 207 tab_.reset([[Tab alloc] initWithWebState:std::move(web_state_impl) |
| 208 model:nil | 208 model:nil |
| 209 attachTabHelpers:NO]); | 209 attachTabHelpers:NO]); |
| 210 web::NavigationManager::WebLoadParams params(GURL("chrome://version/")); | 210 web::NavigationManager::WebLoadParams params(GURL("chrome://version/")); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 [[FakeNativeAppMetadata alloc] init]); | 552 [[FakeNativeAppMetadata alloc] init]); |
| 553 | 553 |
| 554 // Turn auto open on. | 554 // Turn auto open on. |
| 555 [metadata setShouldAutoOpenLinks:YES]; | 555 [metadata setShouldAutoOpenLinks:YES]; |
| 556 int expectedCallCount = 2; | 556 int expectedCallCount = 2; |
| 557 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); | 557 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); |
| 558 EXPECT_FALSE([metadata shouldAutoOpenLinks]); | 558 EXPECT_FALSE([metadata shouldAutoOpenLinks]); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace | 561 } // namespace |
| OLD | NEW |