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

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: fix resource_request_allowed_notifier_test_util.cc 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..1b76afe0a2c02d3bc5441c2313c3432f0d42051f 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
@@ -29,6 +29,9 @@ void TestRequestAllowedNotifier::NotifyObserver() {
// notify observers, as MaybeNotifyObserver checks ResourceRequestsAllowed.
override_requests_allowed_ = true;
requests_allowed_ = true;
+ SetWaitingForNetworkForTesting(true);
+ ResourceRequestAllowedNotifier::ResourceRequestsAllowed();
+ SetWaitingForNetworkForTesting(false);
Alexei Svitkine (slow) 2013/06/17 17:36:13 So I think ResourceRequestsAllowed() should alread
Takashi Toyoshima 2013/06/18 07:21:05 OK, I'll add ForTesting method.
MaybeNotifyObserver();
}
@@ -36,11 +39,9 @@ bool TestRequestAllowedNotifier::ResourceRequestsAllowed() {
// Call ResourceRequestAllowedNotifier::ResourceRequestsAllowed once to
// simulate that the user requested permission. Only return that result if
// the override flag was set.
Alexei Svitkine (slow) 2013/06/17 17:36:13 With this change, this comment becomes incorrect.
Takashi Toyoshima 2013/06/18 07:21:05 I fixed this function because it had two problems.
- bool requests_allowed =
- ResourceRequestAllowedNotifier::ResourceRequestsAllowed();
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