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

Side by Side Diff: chrome/browser/ui/browser_close_unittest.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/download/chrome_download_manager_delegate.h" 10 #include "chrome/browser/download/chrome_download_manager_delegate.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return nullptr; 53 return nullptr;
54 } 54 }
55 #endif 55 #endif
56 bool HasCreatedDownloadManager() override { return true; } 56 bool HasCreatedDownloadManager() override { return true; }
57 57
58 int NonMaliciousDownloadCount() const override { return download_count_; } 58 int NonMaliciousDownloadCount() const override { return download_count_; }
59 59
60 void CancelDownloads() override {} 60 void CancelDownloads() override {}
61 61
62 void SetDownloadManagerDelegateForTesting( 62 void SetDownloadManagerDelegateForTesting(
63 scoped_ptr<ChromeDownloadManagerDelegate> delegate) override { 63 std::unique_ptr<ChromeDownloadManagerDelegate> delegate) override {
64 ADD_FAILURE(); 64 ADD_FAILURE();
65 } 65 }
66 66
67 bool IsShelfEnabled() override { 67 bool IsShelfEnabled() override {
68 return true; 68 return true;
69 } 69 }
70 70
71 // KeyedService 71 // KeyedService
72 void Shutdown() override {} 72 void Shutdown() override {}
73 73
74 private: 74 private:
75 int download_count_; 75 int download_count_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(TestingDownloadService); 77 DISALLOW_COPY_AND_ASSIGN(TestingDownloadService);
78 }; 78 };
79 79
80 static scoped_ptr<KeyedService> CreateTestingDownloadService( 80 static std::unique_ptr<KeyedService> CreateTestingDownloadService(
81 content::BrowserContext* browser_context) { 81 content::BrowserContext* browser_context) {
82 return scoped_ptr<KeyedService>(new TestingDownloadService()); 82 return std::unique_ptr<KeyedService>(new TestingDownloadService());
83 } 83 }
84 84
85 class BrowserCloseTest : public testing::Test { 85 class BrowserCloseTest : public testing::Test {
86 public: 86 public:
87 BrowserCloseTest() 87 BrowserCloseTest()
88 : profile_manager_(TestingBrowserProcess::GetGlobal()), name_index_(0) {} 88 : profile_manager_(TestingBrowserProcess::GetGlobal()), name_index_(0) {}
89 89
90 ~BrowserCloseTest() override {} 90 ~BrowserCloseTest() override {}
91 91
92 void SetUp() override { ASSERT_TRUE(profile_manager_.SetUp()); } 92 void SetUp() override { ASSERT_TRUE(profile_manager_.SetUp()); }
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 Profile* profile = CreateProfile(1, 0); 340 Profile* profile = CreateProfile(1, 0);
341 Profile* incognito_profile = CreateIncognitoProfile(profile, 1, 2); 341 Profile* incognito_profile = CreateIncognitoProfile(profile, 1, 2);
342 342
343 Browser* browser = GetProfileBrowser(incognito_profile, 0); 343 Browser* browser = GetProfileBrowser(incognito_profile, 0);
344 344
345 int num_downloads_blocking = 0; 345 int num_downloads_blocking = 0;
346 EXPECT_EQ(Browser::DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, 346 EXPECT_EQ(Browser::DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE,
347 browser->OkToCloseWithInProgressDownloads(&num_downloads_blocking)); 347 browser->OkToCloseWithInProgressDownloads(&num_downloads_blocking));
348 EXPECT_EQ(2, num_downloads_blocking); 348 EXPECT_EQ(2, num_downloads_blocking);
349 } 349 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/browser_command_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698