| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 311 |
| 312 void CheckCurrentItem(const history::URLResult& historyResult) { | 312 void CheckCurrentItem(const history::URLResult& historyResult) { |
| 313 web::NavigationItem* item = [tab_ navigationManager]->GetVisibleItem(); | 313 web::NavigationItem* item = [tab_ navigationManager]->GetVisibleItem(); |
| 314 CheckHistoryResult(historyResult, item->GetURL(), | 314 CheckHistoryResult(historyResult, item->GetURL(), |
| 315 base::SysUTF16ToNSString(item->GetTitle())); | 315 base::SysUTF16ToNSString(item->GetTitle())); |
| 316 } | 316 } |
| 317 | 317 |
| 318 #ifndef NDEBUG | 318 #ifndef NDEBUG |
| 319 // Method useful when debugging. | 319 // Method useful when debugging. |
| 320 void LogHistoryQueryResult(const history::QueryResults* results) { | 320 void LogHistoryQueryResult(const history::QueryResults* results) { |
| 321 typedef history::QueryResults::URLResultVector::const_iterator iterator; | 321 for (const auto& result : *results) { |
| 322 for (iterator i = results->begin(); i != results->end(); ++i) { | 322 NSLog(@"title = %@; url = %@", base::SysUTF16ToNSString(result.title()), |
| 323 history::URLResult* result = *i; | 323 base::SysUTF8ToNSString(result.url().spec())); |
| 324 NSLog(@"title = %@; url = %@", base::SysUTF16ToNSString(result->title()), | |
| 325 base::SysUTF8ToNSString(result->url().spec())); | |
| 326 } | 324 } |
| 327 } | 325 } |
| 328 #endif | 326 #endif |
| 329 | 327 |
| 330 virtual bool UseOffTheRecordBrowserState() const { return false; } | 328 virtual bool UseOffTheRecordBrowserState() const { return false; } |
| 331 | 329 |
| 332 protected: | 330 protected: |
| 333 web::TestWebThreadBundle thread_bundle_; | 331 web::TestWebThreadBundle thread_bundle_; |
| 334 IOSChromeScopedTestingChromeBrowserStateManager scoped_browser_state_manager_; | 332 IOSChromeScopedTestingChromeBrowserStateManager scoped_browser_state_manager_; |
| 335 std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; | 333 std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 FakeNativeAppMetadata* metadata = [[FakeNativeAppMetadata alloc] init]; | 591 FakeNativeAppMetadata* metadata = [[FakeNativeAppMetadata alloc] init]; |
| 594 | 592 |
| 595 // Turn auto open on. | 593 // Turn auto open on. |
| 596 [metadata setShouldAutoOpenLinks:YES]; | 594 [metadata setShouldAutoOpenLinks:YES]; |
| 597 int expectedCallCount = 2; | 595 int expectedCallCount = 2; |
| 598 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); | 596 TestOpenNativeAppURL(testURL, NO, expectedCallCount, NO); |
| 599 EXPECT_FALSE([metadata shouldAutoOpenLinks]); | 597 EXPECT_FALSE([metadata shouldAutoOpenLinks]); |
| 600 } | 598 } |
| 601 | 599 |
| 602 } // namespace | 600 } // namespace |
| OLD | NEW |