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

Unified Diff: content/shell/test_runner/mock_web_speech_recognizer.cc

Issue 2734713002: WebViewTestProxyBase: clear out main test delegate upon destruction. (Closed)
Patch Set: undo ps#2 Created 3 years, 9 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: content/shell/test_runner/mock_web_speech_recognizer.cc
diff --git a/content/shell/test_runner/mock_web_speech_recognizer.cc b/content/shell/test_runner/mock_web_speech_recognizer.cc
index 56c35ae8afa6561d29378c08f317ba4fa7b4816b..29ca528b32e791bc4d58dcf43bc5fc2c5e2ae1bd 100644
--- a/content/shell/test_runner/mock_web_speech_recognizer.cc
+++ b/content/shell/test_runner/mock_web_speech_recognizer.cc
@@ -160,7 +160,7 @@ MockWebSpeechRecognizer::MockWebSpeechRecognizer()
weak_factory_(this) {}
MockWebSpeechRecognizer::~MockWebSpeechRecognizer() {
- ClearTaskQueue();
+ SetDelegate(nullptr);
}
bool MockWebSpeechRecognizer::Task::isNewContextTask() const {
@@ -169,6 +169,9 @@ bool MockWebSpeechRecognizer::Task::isNewContextTask() const {
void MockWebSpeechRecognizer::SetDelegate(WebTestDelegate* delegate) {
delegate_ = delegate;
+ // No delegate to forward to, clear out pending tasks.
+ if (!delegate_)
+ ClearTaskQueue();
}
void MockWebSpeechRecognizer::SetClientContext(
« no previous file with comments | « no previous file | content/shell/test_runner/web_view_test_proxy.cc » ('j') | content/shell/test_runner/web_view_test_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698