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

Side by Side Diff: chrome/browser/download/download_request_limiter_unittest.cc

Issue 260373002: Revert of [WebsiteSettings] Update permission bubble manager policy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/website_settings/permission_bubble_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/download/download_request_limiter.h" 5 #include "chrome/browser/download/download_request_limiter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/download/download_request_infobar_delegate.h" 10 #include "chrome/browser/download/download_request_infobar_delegate.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 virtual void SetUp() { 65 virtual void SetUp() {
66 ChromeRenderViewHostTestHarness::SetUp(); 66 ChromeRenderViewHostTestHarness::SetUp();
67 InfoBarService::CreateForWebContents(web_contents()); 67 InfoBarService::CreateForWebContents(web_contents());
68 68
69 PermissionBubbleManager::CreateForWebContents(web_contents()); 69 PermissionBubbleManager::CreateForWebContents(web_contents());
70 view_.reset(new FakePermissionBubbleView(this)); 70 view_.reset(new FakePermissionBubbleView(this));
71 PermissionBubbleManager* manager = 71 PermissionBubbleManager* manager =
72 PermissionBubbleManager::FromWebContents(web_contents()); 72 PermissionBubbleManager::FromWebContents(web_contents());
73 manager->SetView(view_.get()); 73 manager->SetView(view_.get());
74 manager->SetCoalesceIntervalForTesting(0);
74 75
75 testing_action_ = ACCEPT; 76 testing_action_ = ACCEPT;
76 ask_allow_count_ = cancel_count_ = continue_count_ = 0; 77 ask_allow_count_ = cancel_count_ = continue_count_ = 0;
77 download_request_limiter_ = new DownloadRequestLimiter(); 78 download_request_limiter_ = new DownloadRequestLimiter();
78 fake_create_callback_ = base::Bind( 79 fake_create_callback_ = base::Bind(
79 &DownloadRequestLimiterTest::FakeCreate, base::Unretained(this)); 80 &DownloadRequestLimiterTest::FakeCreate, base::Unretained(this));
80 DownloadRequestInfoBarDelegate::SetCallbackForTesting( 81 DownloadRequestInfoBarDelegate::SetCallbackForTesting(
81 &fake_create_callback_); 82 &fake_create_callback_);
82 content_settings_ = new HostContentSettingsMap(profile_.GetPrefs(), false); 83 content_settings_ = new HostContentSettingsMap(profile_.GetPrefs(), false);
83 DownloadRequestLimiter::SetContentSettingsForTesting( 84 DownloadRequestLimiter::SetContentSettingsForTesting(
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 CanDownload(); 455 CanDownload();
455 ExpectAndResetCounts(0, 1, 0, __LINE__); 456 ExpectAndResetCounts(0, 1, 0, __LINE__);
456 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, 457 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
457 download_request_limiter_->GetDownloadStatus(web_contents())); 458 download_request_limiter_->GetDownloadStatus(web_contents()));
458 459
459 CanDownload(); 460 CanDownload();
460 ExpectAndResetCounts(0, 1, 0, __LINE__); 461 ExpectAndResetCounts(0, 1, 0, __LINE__);
461 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, 462 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
462 download_request_limiter_->GetDownloadStatus(web_contents())); 463 download_request_limiter_->GetDownloadStatus(web_contents()));
463 } 464 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/website_settings/permission_bubble_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698