| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef IOS_WEB_TEST_WEB_INT_TEST_H_ | 5 #ifndef IOS_WEB_TEST_WEB_INT_TEST_H_ |
| 6 #define IOS_WEB_TEST_WEB_INT_TEST_H_ | 6 #define IOS_WEB_TEST_WEB_INT_TEST_H_ |
| 7 | 7 |
| 8 #import <WebKit/WebKit.h> | 8 #import <WebKit/WebKit.h> |
| 9 | 9 |
| 10 #import "base/ios/block_types.h" | 10 #import "base/ios/block_types.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // returns the result. | 44 // returns the result. |
| 45 id ExecuteJavaScript(NSString* script); | 45 id ExecuteJavaScript(NSString* script); |
| 46 | 46 |
| 47 // Executes |block| and waits until |url| is successfully loaded in | 47 // Executes |block| and waits until |url| is successfully loaded in |
| 48 // |web_state_|. | 48 // |web_state_|. |
| 49 void ExecuteBlockAndWaitForLoad(const GURL& url, ProceduralBlock block); | 49 void ExecuteBlockAndWaitForLoad(const GURL& url, ProceduralBlock block); |
| 50 | 50 |
| 51 // Navigates |web_state_| to |url| and waits for the page to be loaded. | 51 // Navigates |web_state_| to |url| and waits for the page to be loaded. |
| 52 void LoadUrl(const GURL& url); | 52 void LoadUrl(const GURL& url); |
| 53 | 53 |
| 54 // Navigates |web_state_| using |params| and waits for the page to be loaded. |
| 55 void LoadWithParams(const NavigationManager::WebLoadParams& params); |
| 56 |
| 54 // Synchronously removes data from |data_store|. | 57 // Synchronously removes data from |data_store|. |
| 55 // |websiteDataTypes| is from the constants defined in | 58 // |websiteDataTypes| is from the constants defined in |
| 56 // "WebKit/WKWebsiteDataRecord". | 59 // "WebKit/WKWebsiteDataRecord". |
| 57 void RemoveWKWebViewCreatedData(WKWebsiteDataStore* data_store, | 60 void RemoveWKWebViewCreatedData(WKWebsiteDataStore* data_store, |
| 58 NSSet* websiteDataTypes); | 61 NSSet* websiteDataTypes); |
| 59 | 62 |
| 60 // Returns the index of |item| in the |navigation_manager|'s session history, | 63 // Returns the index of |item| in the |navigation_manager|'s session history, |
| 61 // or NSNotFound if it is not present. | 64 // or NSNotFound if it is not present. |
| 62 NSInteger GetIndexOfNavigationItem(const web::NavigationItem* item); | 65 NSInteger GetIndexOfNavigationItem(const web::NavigationItem* item); |
| 63 | 66 |
| 64 web::TestWebStateDelegate web_state_delegate_; | 67 web::TestWebStateDelegate web_state_delegate_; |
| 65 | 68 |
| 66 private: | 69 private: |
| 67 // WebState used to load pages. | 70 // WebState used to load pages. |
| 68 std::unique_ptr<WebState> web_state_; | 71 std::unique_ptr<WebState> web_state_; |
| 69 // WebStateObserver used to wait for page loads. | 72 // WebStateObserver used to wait for page loads. |
| 70 std::unique_ptr<IntTestWebStateObserver> observer_; | 73 std::unique_ptr<IntTestWebStateObserver> observer_; |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 } // namespace web | 76 } // namespace web |
| 74 | 77 |
| 75 #endif // IOS_WEB_TEST_WEB_INT_TEST_H_ | 78 #endif // IOS_WEB_TEST_WEB_INT_TEST_H_ |
| OLD | NEW |