| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "content/public/common/frame_navigate_params.h" | 22 #include "content/public/common/frame_navigate_params.h" |
| 23 #include "content/public/test/web_contents_tester.h" | 23 #include "content/public/test/web_contents_tester.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 | 25 |
| 26 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
| 27 #include "chrome/browser/download/download_request_infobar_delegate_android.h" | 27 #include "chrome/browser/download/download_request_infobar_delegate_android.h" |
| 28 #include "chrome/browser/infobars/infobar_service.h" | 28 #include "chrome/browser/infobars/infobar_service.h" |
| 29 #else | 29 #else |
| 30 #include "chrome/browser/download/download_permission_request.h" | 30 #include "chrome/browser/download/download_permission_request.h" |
| 31 #include "chrome/browser/permissions/permission_request_manager.h" | 31 #include "chrome/browser/permissions/permission_request_manager.h" |
| 32 #include "chrome/browser/ui/website_settings/mock_permission_prompt_factory.h" | 32 #include "chrome/browser/ui/permission_bubble/mock_permission_prompt_factory.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 using content::WebContents; | 35 using content::WebContents; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 enum TestingAction { | 38 enum TestingAction { |
| 39 ACCEPT, | 39 ACCEPT, |
| 40 CANCEL, | 40 CANCEL, |
| 41 WAIT | 41 WAIT |
| 42 }; | 42 }; |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 // changing the content setting). | 693 // changing the content setting). |
| 694 UpdateContentSettings(web_contents(), CONTENT_SETTING_ASK); | 694 UpdateContentSettings(web_contents(), CONTENT_SETTING_ASK); |
| 695 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 695 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
| 696 download_request_limiter_->GetDownloadStatus(web_contents())); | 696 download_request_limiter_->GetDownloadStatus(web_contents())); |
| 697 UpdateExpectations(WAIT); | 697 UpdateExpectations(WAIT); |
| 698 CanDownload(); | 698 CanDownload(); |
| 699 ExpectAndResetCounts(0, 0, 1, __LINE__); | 699 ExpectAndResetCounts(0, 0, 1, __LINE__); |
| 700 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, | 700 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, |
| 701 download_request_limiter_->GetDownloadStatus(web_contents())); | 701 download_request_limiter_->GetDownloadStatus(web_contents())); |
| 702 } | 702 } |
| OLD | NEW |