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

Unified Diff: chrome/browser/web_resource/resource_request_allowed_notifier_test_util.cc

Issue 16841020: ResourceRequestAllowedNotifier didn't work as expected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove redundant call, and fix comments Created 7 years, 6 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: chrome/browser/web_resource/resource_request_allowed_notifier_test_util.cc
diff --git a/chrome/browser/web_resource/resource_request_allowed_notifier_test_util.cc b/chrome/browser/web_resource/resource_request_allowed_notifier_test_util.cc
index 073c4bcffa38c913db5ce2dcddce22a0a2e2cb66..321023fbf5da174e4060f7ba38bbb411f68a11e7 100644
--- a/chrome/browser/web_resource/resource_request_allowed_notifier_test_util.cc
+++ b/chrome/browser/web_resource/resource_request_allowed_notifier_test_util.cc
@@ -25,22 +25,22 @@ void TestRequestAllowedNotifier::SetRequestsAllowedOverride(bool allowed) {
}
void TestRequestAllowedNotifier::NotifyObserver() {
- // Force the allowed state to true. This forces MaybeNotifyObserver to always
- // notify observers, as MaybeNotifyObserver checks ResourceRequestsAllowed.
+ // Force the allowed state and requested state to true. This forces
+ // MaybeNotifyObserver to always notify observers, as MaybeNotifyObserver
+ // checks ResourceRequestsAllowed and requested state.
override_requests_allowed_ = true;
requests_allowed_ = true;
+ SetObserverRequestedForTesting(true);
MaybeNotifyObserver();
}
bool TestRequestAllowedNotifier::ResourceRequestsAllowed() {
- // Call ResourceRequestAllowedNotifier::ResourceRequestsAllowed once to
- // simulate that the user requested permission. Only return that result if
- // the override flag was set.
- bool requests_allowed =
- ResourceRequestAllowedNotifier::ResourceRequestsAllowed();
+ // Return the override result if the override flag was set. Otherwise, call
+ // ResourceRequestAllowedNotifier::ResourceRequestsAllowed and return the
+ // result.
Alexei Svitkine (slow) 2013/06/18 15:35:04 Nit: This comment no longer describes something tr
Takashi Toyoshima 2013/06/19 04:35:40 Done.
if (override_requests_allowed_)
return requests_allowed_;
- return requests_allowed;
+ return ResourceRequestAllowedNotifier::ResourceRequestsAllowed();
}
EulaAcceptedNotifier* TestRequestAllowedNotifier::CreateEulaNotifier() {

Powered by Google App Engine
This is Rietveld 408576698