| OLD | NEW |
| 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 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 virtual void Show( | 43 virtual void Show( |
| 44 const std::vector<PermissionBubbleRequest*>& requests, | 44 const std::vector<PermissionBubbleRequest*>& requests, |
| 45 const std::vector<bool>& accept_state, | 45 const std::vector<bool>& accept_state, |
| 46 bool customization_mode) OVERRIDE; | 46 bool customization_mode) OVERRIDE; |
| 47 | 47 |
| 48 virtual bool CanAcceptRequestUpdate() OVERRIDE { return false; } | 48 virtual bool CanAcceptRequestUpdate() OVERRIDE { return false; } |
| 49 | 49 |
| 50 virtual void Hide() OVERRIDE {} | 50 virtual void Hide() OVERRIDE {} |
| 51 virtual bool IsVisible() OVERRIDE { return false; } |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 DownloadRequestLimiterTest* test_; | 54 DownloadRequestLimiterTest* test_; |
| 54 Delegate* delegate_; | 55 Delegate* delegate_; |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 class DownloadRequestLimiterTest : public ChromeRenderViewHostTestHarness { | 58 class DownloadRequestLimiterTest : public ChromeRenderViewHostTestHarness { |
| 58 public: | 59 public: |
| 59 enum TestingAction { | 60 enum TestingAction { |
| 60 ACCEPT, | 61 ACCEPT, |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 CanDownload(); | 454 CanDownload(); |
| 454 ExpectAndResetCounts(0, 1, 0, __LINE__); | 455 ExpectAndResetCounts(0, 1, 0, __LINE__); |
| 455 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 456 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
| 456 download_request_limiter_->GetDownloadStatus(web_contents())); | 457 download_request_limiter_->GetDownloadStatus(web_contents())); |
| 457 | 458 |
| 458 CanDownload(); | 459 CanDownload(); |
| 459 ExpectAndResetCounts(0, 1, 0, __LINE__); | 460 ExpectAndResetCounts(0, 1, 0, __LINE__); |
| 460 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 461 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
| 461 download_request_limiter_->GetDownloadStatus(web_contents())); | 462 download_request_limiter_->GetDownloadStatus(web_contents())); |
| 462 } | 463 } |
| OLD | NEW |