Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: ios/web/test/web_int_test.mm

Issue 2644223002: Integration tests for WebStateDelegate::OnAuthRequired callback. (Closed)
Patch Set: Addressed review comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web/test/web_int_test.mm
diff --git a/ios/web/test/web_int_test.mm b/ios/web/test/web_int_test.mm
index 365d2b0de8be99a6b653b7cc77a56763ee21211b..eda2a9823eb4ccd7db9a507ffd0ee45794326f7f 100644
--- a/ios/web/test/web_int_test.mm
+++ b/ios/web/test/web_int_test.mm
@@ -61,10 +61,9 @@ void WebIntTest::SetUp() {
RemoveWKWebViewCreatedData([WKWebsiteDataStore defaultDataStore],
[WKWebsiteDataStore allWebsiteDataTypes]);
- // Create the WebState and its WebStateObserver.
+ // Create the WebState.
web::WebState::CreateParams web_state_create_params(GetBrowserState());
web_state_ = web::WebState::Create(web_state_create_params);
- observer_ = base::WrapUnique(new IntTestWebStateObserver(web_state()));
// Resize the webview so that pages can be properly rendered.
web_state()->GetView().frame =
@@ -72,6 +71,8 @@ void WebIntTest::SetUp() {
// Enable web usage for the WebState.
web_state()->SetWebUsageEnabled(true);
+
+ web_state()->SetDelegate(&web_state_delegate_);
}
void WebIntTest::TearDown() {
@@ -92,6 +93,7 @@ id WebIntTest::ExecuteJavaScript(NSString* script) {
void WebIntTest::ExecuteBlockAndWaitForLoad(const GURL& url,
ProceduralBlock block) {
DCHECK(block);
+ observer_ = base::WrapUnique(new IntTestWebStateObserver(web_state()));
michaeldo 2017/01/20 23:48:24 Use MakeUnique instead here? // MakeUnique<T>(arg
Eugene But (OOO till 7-30) 2017/01/21 01:42:10 Done.
observer_->ExpectPageLoad(url);
block();
base::test::ios::WaitUntilCondition(^bool {

Powered by Google App Engine
This is Rietveld 408576698