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 27 matching lines...) Expand all Loading... |
38 // PermissionBubbleView: | 38 // PermissionBubbleView: |
39 virtual void SetDelegate(Delegate* delegate) OVERRIDE { | 39 virtual void SetDelegate(Delegate* delegate) OVERRIDE { |
40 delegate_ = delegate; | 40 delegate_ = delegate; |
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; } |
| 49 |
48 virtual void Hide() OVERRIDE {} | 50 virtual void Hide() OVERRIDE {} |
49 | 51 |
50 private: | 52 private: |
51 DownloadRequestLimiterTest* test_; | 53 DownloadRequestLimiterTest* test_; |
52 Delegate* delegate_; | 54 Delegate* delegate_; |
53 }; | 55 }; |
54 | 56 |
55 class DownloadRequestLimiterTest : public ChromeRenderViewHostTestHarness { | 57 class DownloadRequestLimiterTest : public ChromeRenderViewHostTestHarness { |
56 public: | 58 public: |
57 enum TestingAction { | 59 enum TestingAction { |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 CanDownload(); | 455 CanDownload(); |
454 ExpectAndResetCounts(0, 1, 0, __LINE__); | 456 ExpectAndResetCounts(0, 1, 0, __LINE__); |
455 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 457 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
456 download_request_limiter_->GetDownloadStatus(web_contents())); | 458 download_request_limiter_->GetDownloadStatus(web_contents())); |
457 | 459 |
458 CanDownload(); | 460 CanDownload(); |
459 ExpectAndResetCounts(0, 1, 0, __LINE__); | 461 ExpectAndResetCounts(0, 1, 0, __LINE__); |
460 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 462 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
461 download_request_limiter_->GetDownloadStatus(web_contents())); | 463 download_request_limiter_->GetDownloadStatus(web_contents())); |
462 } | 464 } |
OLD | NEW |