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

Side by Side Diff: chrome/browser/safe_browsing/unverified_download_policy_unittest.cc

Issue 1870003002: Convert //chrome/browser/safe_browsing from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments Created 4 years, 8 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
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/safe_browsing/unverified_download_policy.h" 5 #include "chrome/browser/safe_browsing/unverified_download_policy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 browser_process->safe_browsing_service()->ShutDown(); 117 browser_process->safe_browsing_service()->ShutDown();
118 browser_process->SetSafeBrowsingService(nullptr); 118 browser_process->SetSafeBrowsingService(nullptr);
119 testing_safe_browsing_service_ = nullptr; 119 testing_safe_browsing_service_ = nullptr;
120 SafeBrowsingService::RegisterFactory(nullptr); 120 SafeBrowsingService::RegisterFactory(nullptr);
121 base::RunLoop().RunUntilIdle(); 121 base::RunLoop().RunUntilIdle();
122 } 122 }
123 123
124 protected: 124 protected:
125 content::TestBrowserThreadBundle thread_bundle_; 125 content::TestBrowserThreadBundle thread_bundle_;
126 TestSafeBrowsingServiceFactory test_safe_browsing_service_factory_; 126 TestSafeBrowsingServiceFactory test_safe_browsing_service_factory_;
127 scoped_ptr<TestingProfileManager> testing_profile_manager_; 127 std::unique_ptr<TestingProfileManager> testing_profile_manager_;
128 scoped_refptr<SafeBrowsingService> testing_safe_browsing_service_; 128 scoped_refptr<SafeBrowsingService> testing_safe_browsing_service_;
129 TestingProfile* testing_profile_ = nullptr; 129 TestingProfile* testing_profile_ = nullptr;
130 }; 130 };
131 131
132 } // namespace 132 } // namespace
133 133
134 // Verify that SafeBrowsing whitelists can override field trials. 134 // Verify that SafeBrowsing whitelists can override field trials.
135 TEST_F(UnverifiedDownloadPolicyTest, Whitelist) { 135 TEST_F(UnverifiedDownloadPolicyTest, Whitelist) {
136 base::CommandLine::ForCurrentProcess()->AppendSwitch( 136 base::CommandLine::ForCurrentProcess()->AppendSwitch(
137 switches::kDisallowUncheckedDangerousDownloads); 137 switches::kDisallowUncheckedDangerousDownloads);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 CompletionCallback completion_callback; 220 CompletionCallback completion_callback;
221 CheckUnverifiedDownloadPolicy(GURL("http://supported.example.com/foo/bar"), 221 CheckUnverifiedDownloadPolicy(GURL("http://supported.example.com/foo/bar"),
222 test_file_path, test_extensions, 222 test_file_path, test_extensions,
223 completion_callback.GetCallback()); 223 completion_callback.GetCallback());
224 EXPECT_EQ(UnverifiedDownloadPolicy::ALLOWED, 224 EXPECT_EQ(UnverifiedDownloadPolicy::ALLOWED,
225 completion_callback.WaitForResult()); 225 completion_callback.WaitForResult());
226 } 226 }
227 227
228 } // namespace safe_browsing 228 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698