| 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 "ios/web/test/web_test.h" | 5 #import "ios/web/test/web_test.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 mainDocumentURL:(const GURL&)mainDocumentURL | 31 mainDocumentURL:(const GURL&)mainDocumentURL |
| 32 linkClicked:(BOOL)linkClicked { | 32 linkClicked:(BOOL)linkClicked { |
| 33 return YES; | 33 return YES; |
| 34 } | 34 } |
| 35 @end | 35 @end |
| 36 | 36 |
| 37 namespace web { | 37 namespace web { |
| 38 | 38 |
| 39 #pragma mark - | 39 #pragma mark - |
| 40 | 40 |
| 41 WebTest::WebTest() : web_client_(base::WrapUnique(new TestWebClient)) { | 41 WebTest::WebTest() : web_client_(base::WrapUnique(new TestWebClient)) {} |
| 42 static dispatch_once_t onceToken; | |
| 43 dispatch_once(&onceToken, ^{ | |
| 44 RegisterWebSchemes(false); | |
| 45 }); | |
| 46 } | |
| 47 | 42 |
| 48 WebTest::~WebTest() {} | 43 WebTest::~WebTest() {} |
| 49 | 44 |
| 50 void WebTest::SetUp() { | 45 void WebTest::SetUp() { |
| 51 PlatformTest::SetUp(); | 46 PlatformTest::SetUp(); |
| 52 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true); | 47 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(true); |
| 53 } | 48 } |
| 54 | 49 |
| 55 void WebTest::TearDown() { | 50 void WebTest::TearDown() { |
| 56 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); | 51 BrowserState::GetActiveStateManager(&browser_state_)->SetActive(false); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 213 } |
| 219 return false; | 214 return false; |
| 220 } | 215 } |
| 221 | 216 |
| 222 NSString* WebTestWithWebController::CreateLoadCheck() { | 217 NSString* WebTestWithWebController::CreateLoadCheck() { |
| 223 return [NSString stringWithFormat:@"<p style=\"display: none;\">%d</p>", | 218 return [NSString stringWithFormat:@"<p style=\"display: none;\">%d</p>", |
| 224 s_html_load_count++]; | 219 s_html_load_count++]; |
| 225 } | 220 } |
| 226 | 221 |
| 227 } // namespace web | 222 } // namespace web |
| OLD | NEW |