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

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

Issue 1982723002: Use FileTypePolicies for download danger classifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_policies
Patch Set: Fix bad rebase Created 4 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
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_browsertest.h" 5 #include "chrome/browser/download/download_browsertest.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <sstream> 8 #include <sstream>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "chrome/browser/ui/browser_list.h" 57 #include "chrome/browser/ui/browser_list.h"
58 #include "chrome/browser/ui/browser_tabstrip.h" 58 #include "chrome/browser/ui/browser_tabstrip.h"
59 #include "chrome/browser/ui/browser_window.h" 59 #include "chrome/browser/ui/browser_window.h"
60 #include "chrome/browser/ui/chrome_pages.h" 60 #include "chrome/browser/ui/chrome_pages.h"
61 #include "chrome/browser/ui/tabs/tab_strip_model.h" 61 #include "chrome/browser/ui/tabs/tab_strip_model.h"
62 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" 62 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
63 #include "chrome/common/chrome_paths.h" 63 #include "chrome/common/chrome_paths.h"
64 #include "chrome/common/chrome_switches.h" 64 #include "chrome/common/chrome_switches.h"
65 #include "chrome/common/pref_names.h" 65 #include "chrome/common/pref_names.h"
66 #include "chrome/common/safe_browsing/csd.pb.h" 66 #include "chrome/common/safe_browsing/csd.pb.h"
67 #include "chrome/common/safe_browsing/download_file_types.pb.h"
67 #include "chrome/common/url_constants.h" 68 #include "chrome/common/url_constants.h"
68 #include "chrome/grit/generated_resources.h" 69 #include "chrome/grit/generated_resources.h"
69 #include "chrome/test/base/in_process_browser_test.h" 70 #include "chrome/test/base/in_process_browser_test.h"
70 #include "chrome/test/base/ui_test_utils.h" 71 #include "chrome/test/base/ui_test_utils.h"
71 #include "components/history/content/browser/download_constants_utils.h" 72 #include "components/history/content/browser/download_constants_utils.h"
72 #include "components/history/core/browser/download_constants.h" 73 #include "components/history/core/browser/download_constants.h"
73 #include "components/history/core/browser/download_row.h" 74 #include "components/history/core/browser/download_row.h"
74 #include "components/history/core/browser/history_service.h" 75 #include "components/history/core/browser/history_service.h"
75 #include "components/infobars/core/confirm_infobar_delegate.h" 76 #include "components/infobars/core/confirm_infobar_delegate.h"
76 #include "components/infobars/core/infobar.h" 77 #include "components/infobars/core/infobar.h"
(...skipping 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 3203
3203 if (final_state_seen_) 3204 if (final_state_seen_)
3204 return true; 3205 return true;
3205 3206
3206 final_state_seen_ = true; 3207 final_state_seen_ = true;
3207 browser_->profile()->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnabled, 3208 browser_->profile()->GetPrefs()->SetBoolean(prefs::kSafeBrowsingEnabled,
3208 false); 3209 false);
3209 EXPECT_EQ(content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT, 3210 EXPECT_EQ(content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
3210 download->GetDangerType()); 3211 download->GetDangerType());
3211 EXPECT_FALSE(download->IsDangerous()); 3212 EXPECT_FALSE(download->IsDangerous());
3212 EXPECT_NE(download_util::NOT_DANGEROUS, 3213 EXPECT_NE(safe_browsing::DownloadFileType::NOT_DANGEROUS,
3213 DownloadItemModel(download).GetDangerLevel()); 3214 DownloadItemModel(download).GetDangerLevel());
3214 return true; 3215 return true;
3215 } 3216 }
3216 3217
3217 private: 3218 private:
3218 Browser* browser_; 3219 Browser* browser_;
3219 bool final_state_seen_; 3220 bool final_state_seen_;
3220 }; 3221 };
3221 3222
3222 #if defined(OS_WIN) 3223 #if defined(OS_WIN)
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
3678 DangerousDownloadWaiter( 3679 DangerousDownloadWaiter(
3679 browser(), 1, 3680 browser(), 1,
3680 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); 3681 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY));
3681 ui_test_utils::NavigateToURL(browser(), extension_url); 3682 ui_test_utils::NavigateToURL(browser(), extension_url);
3682 3683
3683 observer->WaitForFinished(); 3684 observer->WaitForFinished();
3684 3685
3685 // Download shelf should close. 3686 // Download shelf should close.
3686 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); 3687 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible());
3687 } 3688 }
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate_unittest.cc ('k') | chrome/browser/download/download_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698