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

Unified Diff: ios/web/public/test/web_test_with_web_state.mm

Issue 2779263002: Set user agent type of transient item the same as pending item. (Closed)
Patch Set: Fix unit tests Created 3 years, 8 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/public/test/web_test_with_web_state.mm
diff --git a/ios/web/public/test/web_test_with_web_state.mm b/ios/web/public/test/web_test_with_web_state.mm
index 9ee621e25276d62409c556f40ac4e203b2dc5f8d..c9e5c832ecea4bbc9f7198da13023132eb47c98b 100644
--- a/ios/web/public/test/web_test_with_web_state.mm
+++ b/ios/web/public/test/web_test_with_web_state.mm
@@ -7,6 +7,7 @@
#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h"
+#import "ios/web/navigation/navigation_manager_impl.h"
#include "ios/web/public/web_state/url_verification_constants.h"
#include "ios/web/public/web_state/web_state_observer.h"
#import "ios/web/web_state/ui/crw_web_controller.h"
@@ -148,6 +149,15 @@ void NavigationItemCommitted(const LoadCommittedDetails&) override {
return web_state_.get();
}
+void WebTestWithWebState::AddPendingItem(const GURL& url,
+ ui::PageTransition transition) {
+ WebStateImpl* web_state = static_cast<web::WebStateImpl*>(web_state_.get());
+ web_state->GetNavigationManagerImpl().AddPendingItem(
Eugene But (OOO till 7-30) 2017/04/04 18:22:31 GetWebController(web_state())->GetNavigationManage
liaoyuke 2017/04/04 21:15:40 Done.
+ url, Referrer(), transition,
+ web::NavigationInitiationType::USER_INITIATED,
+ web::NavigationManager::UserAgentOverrideOption::INHERIT);
+}
+
void WebTestWithWebState::WillProcessTask(const base::PendingTask&) {
// Nothing to do.
}

Powered by Google App Engine
This is Rietveld 408576698