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

Unified Diff: extensions/test/extension_test_message_listener.cc

Issue 2017113002: [Extensions] DCHECK that ExtensionFunctions respond (and only once) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « extensions/browser/extension_function_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/extension_test_message_listener.cc
diff --git a/extensions/test/extension_test_message_listener.cc b/extensions/test/extension_test_message_listener.cc
index 2712dc3c9f5864a1e9353fd6cc9b166914fdc8a2..5b084f78ba154259a5618d1f91cb1f843fc3400e 100644
--- a/extensions/test/extension_test_message_listener.cc
+++ b/extensions/test/extension_test_message_listener.cc
@@ -96,9 +96,14 @@ void ExtensionTestMessageListener::Observe(
// We should have an empty message if we're not already satisfied.
CHECK(message_.empty());
- const std::string& message = *content::Details<std::string>(details).ptr();
+ std::pair<std::string, bool*>* message_details =
+ content::Details<std::pair<std::string, bool*>>(details).ptr();
+ const std::string& message = message_details->first;
if (message == expected_message_ || wait_for_any_message_ ||
(!failure_message_.empty() && message == failure_message_)) {
+ // We always reply to the message we were waiting for, even if it's just an
+ // empty string.
+ *message_details->second = true;
message_ = message;
satisfied_ = true;
failed_ = (message_ == failure_message_);
« no previous file with comments | « extensions/browser/extension_function_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698