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

Unified Diff: ios/web/web_state/web_state_impl_unittest.mm

Issue 2710913006: Removed -[CRWWebDelegate webController:titleDidChange:]. (Closed)
Patch Set: Rebased Created 3 years, 10 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
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/web_state/web_state_observer_bridge.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_state_impl_unittest.mm
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm
index 3aa7097011a1b22d10224c578d8cef5c0de1a014..dfd34691fa5a80db13a8e2600c412f168f8a926a 100644
--- a/ios/web/web_state/web_state_impl_unittest.mm
+++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -129,6 +129,7 @@ class TestWebStateObserver : public WebStateObserver {
page_loaded_called_with_success_(false),
history_state_changed_called_(false),
did_finish_navigation_called_(false),
+ title_was_set_called_(false),
web_state_destroyed_called_(false) {}
// Methods returning true if the corresponding WebStateObserver method has
@@ -154,6 +155,7 @@ class TestWebStateObserver : public WebStateObserver {
bool did_finish_navigation_called() const {
return did_finish_navigation_called_;
}
+ bool title_was_set_called() const { return title_was_set_called_; }
bool web_state_destroyed_called() const {
return web_state_destroyed_called_;
}
@@ -180,6 +182,7 @@ class TestWebStateObserver : public WebStateObserver {
page_loaded_called_with_success_ =
load_completion_status == PageLoadCompletionStatus::SUCCESS;
}
+ void TitleWasSet() override { title_was_set_called_ = true; }
void WebStateDestroyed() override {
EXPECT_TRUE(web_state()->IsBeingDestroyed());
web_state_destroyed_called_ = true;
@@ -193,6 +196,7 @@ class TestWebStateObserver : public WebStateObserver {
bool page_loaded_called_with_success_;
bool history_state_changed_called_;
bool did_finish_navigation_called_;
+ bool title_was_set_called_;
bool web_state_destroyed_called_;
};
@@ -399,6 +403,11 @@ TEST_F(WebStateTest, ObserverTest) {
web_state_->OnErrorPageNavigation(GURL("http://test"));
EXPECT_TRUE(observer->did_finish_navigation_called());
+ // Test that OnTitleChanged() is called.
+ EXPECT_FALSE(observer->title_was_set_called());
+ web_state_->OnTitleChanged();
+ EXPECT_TRUE(observer->title_was_set_called());
+
// Test that WebStateDestroyed() is called.
EXPECT_FALSE(observer->web_state_destroyed_called());
web_state_.reset();
« no previous file with comments | « ios/web/web_state/web_state_impl.mm ('k') | ios/web/web_state/web_state_observer_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698