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

Unified Diff: chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_browsertest.mm

Issue 2561673003: Handle per-tab AUTOMATIC_DOWNLOADS setting in DownloadRequestLimiter. (Closed)
Patch Set: Get HostContentSettingsMap directly in DRL tests Created 3 years, 10 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/ui/cocoa/content_settings/content_setting_bubble_cocoa_browsertest.mm
diff --git a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_browsertest.mm
index 1f0f6d08b6a22ca6daf5264f5894bbe52240f974..c53d1a3c43f8c891a06b2992b4c31f8bc407f7d8 100644
--- a/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_browsertest.mm
+++ b/chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa_browsertest.mm
@@ -8,7 +8,9 @@
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/mac/scoped_nsobject.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
+#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h"
@@ -21,8 +23,6 @@
#include "testing/gtest_mac.h"
#include "ui/base/l10n/l10n_util.h"
-namespace {
-
class ContentSettingBubbleControllerTest : public InProcessBrowserTest {
protected:
ContentSettingBubbleControllerTest() {}
@@ -72,6 +72,13 @@ ContentSettingBubbleControllerTest::CreateBubbleController(
IN_PROC_BROWSER_TEST_F(ContentSettingBubbleControllerTest, Init) {
TabSpecificContentSettings::FromWebContents(web_contents())->
BlockAllContentForTesting();
+
+ // Automatic downloads are handled by DownloadRequestLimiter.
+ g_browser_process->download_request_limiter()
+ ->GetDownloadState(web_contents(), web_contents(), true)
+ ->SetDownloadStatusAndNotify(
+ DownloadRequestLimiter::DOWNLOADS_NOT_ALLOWED);
+
std::vector<std::unique_ptr<ContentSettingImageModel>> models =
ContentSettingImageModel::GenerateContentSettingImageModels();
for (const auto& model : models) {
@@ -110,5 +117,3 @@ IN_PROC_BROWSER_TEST_F(ContentSettingBubbleControllerTest, MediaStreamBubble) {
[parent_ close];
}
-
-} // namespace

Powered by Google App Engine
This is Rietveld 408576698