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

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

Issue 2559693003: [ObjC ARC] Converts ios/chrome/browser/passwords:unit_tests to ARC. (Closed)
Patch Set: Cleanup Created 4 years 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/test_web_state.mm
diff --git a/ios/web/public/test/test_web_state.mm b/ios/web/public/test/test_web_state.mm
index 3906434aad0d174b0b23fe0a9107ab3f534dcc77..3d35c1f7abdc2ec3507677c20a0759967d431967 100644
--- a/ios/web/public/test/test_web_state.mm
+++ b/ios/web/public/test/test_web_state.mm
@@ -7,16 +7,30 @@
#include <stdint.h>
#include "base/callback.h"
+#include "ios/web/public/web_state/web_state_observer.h"
namespace web {
+void TestWebState::AddObserver(WebStateObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void TestWebState::RemoveObserver(WebStateObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
TestWebState::TestWebState()
: web_usage_enabled_(false),
is_loading_(false),
trust_level_(kAbsolute),
content_is_html_(true) {}
-TestWebState::~TestWebState() = default;
+TestWebState::~TestWebState() {
+ for (auto& observer : observers_)
+ observer.WebStateDestroyed();
+ for (auto& observer : observers_)
+ observer.ResetWebState();
+};
WebStateDelegate* TestWebState::GetDelegate() {
return nil;

Powered by Google App Engine
This is Rietveld 408576698