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" | |
10 #include "chrome/browser/download/download_request_infobar_delegate.h" | 9 #include "chrome/browser/download/download_request_infobar_delegate.h" |
11 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
12 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 11 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
14 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 14 #include "components/content_settings/core/browser/host_content_settings_map.h" |
15 #include "content/public/browser/navigation_controller.h" | 15 #include "content/public/browser/navigation_controller.h" |
16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 using content::WebContents; | 19 using content::WebContents; |
20 | 20 |
21 class DownloadRequestLimiterTest; | 21 class DownloadRequestLimiterTest; |
22 | 22 |
23 class FakePermissionBubbleView : public PermissionBubbleView { | 23 class FakePermissionBubbleView : public PermissionBubbleView { |
24 public: | 24 public: |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 CanDownload(); | 451 CanDownload(); |
452 ExpectAndResetCounts(0, 1, 0, __LINE__); | 452 ExpectAndResetCounts(0, 1, 0, __LINE__); |
453 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 453 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
454 download_request_limiter_->GetDownloadStatus(web_contents())); | 454 download_request_limiter_->GetDownloadStatus(web_contents())); |
455 | 455 |
456 CanDownload(); | 456 CanDownload(); |
457 ExpectAndResetCounts(0, 1, 0, __LINE__); | 457 ExpectAndResetCounts(0, 1, 0, __LINE__); |
458 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 458 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
459 download_request_limiter_->GetDownloadStatus(web_contents())); | 459 download_request_limiter_->GetDownloadStatus(web_contents())); |
460 } | 460 } |
OLD | NEW |