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

Unified Diff: content/test/web_contents_observer_sanity_checker.cc

Issue 1693353002: Reland #2 Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits + rebase Created 4 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 | « content/test/web_contents_observer_sanity_checker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/web_contents_observer_sanity_checker.cc
diff --git a/content/test/web_contents_observer_sanity_checker.cc b/content/test/web_contents_observer_sanity_checker.cc
index 24b8ac945d9f258084c9f1923390a4d4c8a1312b..5290e191323ba410f32ce8eb168840f6627d6832 100644
--- a/content/test/web_contents_observer_sanity_checker.cc
+++ b/content/test/web_contents_observer_sanity_checker.cc
@@ -330,10 +330,25 @@ void WebContentsObserverSanityChecker::WebContentsDestroyed() {
CHECK(active_media_players_.empty());
}
+void WebContentsObserverSanityChecker::DidStartLoading() {
+ // TODO(clamy): add checks for the loading state in the rest of observer
+ // methods.
+ CHECK(!is_loading_);
+ CHECK(web_contents()->IsLoading());
+ is_loading_ = true;
+}
+
+void WebContentsObserverSanityChecker::DidStopLoading() {
+ CHECK(is_loading_);
+ CHECK(!web_contents()->IsLoading());
+ is_loading_ = false;
+}
+
WebContentsObserverSanityChecker::WebContentsObserverSanityChecker(
WebContents* web_contents)
- : WebContentsObserver(web_contents), web_contents_destroyed_(false) {
-}
+ : WebContentsObserver(web_contents),
+ is_loading_(false),
+ web_contents_destroyed_(false) {}
WebContentsObserverSanityChecker::~WebContentsObserverSanityChecker() {
CHECK(web_contents_destroyed_);
« no previous file with comments | « content/test/web_contents_observer_sanity_checker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698