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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/extensions/api/downloads/downloads_api.h" 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/download/download_history.h" 9 #include "chrome/browser/download/download_history.h"
10 #include "chrome/browser/download/download_service_factory.h" 10 #include "chrome/browser/download/download_service_factory.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 std::unique_ptr<MockDownloadManager> manager_; 102 std::unique_ptr<MockDownloadManager> manager_;
103 content::DownloadManager::Observer* download_history_manager_observer_; 103 content::DownloadManager::Observer* download_history_manager_observer_;
104 104
105 DISALLOW_COPY_AND_ASSIGN(DownloadsApiUnitTest); 105 DISALLOW_COPY_AND_ASSIGN(DownloadsApiUnitTest);
106 }; 106 };
107 107
108 // static 108 // static
109 std::unique_ptr<KeyedService> 109 std::unique_ptr<KeyedService>
110 DownloadsApiUnitTest::TestingDownloadServiceFactory( 110 DownloadsApiUnitTest::TestingDownloadServiceFactory(
111 content::BrowserContext* browser_context) { 111 content::BrowserContext* browser_context) {
112 return base::WrapUnique( 112 return base::MakeUnique<TestDownloadService>(
113 new TestDownloadService(Profile::FromBrowserContext(browser_context))); 113 Profile::FromBrowserContext(browser_context));
114 } 114 }
115 115
116 // Tests that Number/double properties in query are parsed correctly. 116 // Tests that Number/double properties in query are parsed correctly.
117 // Regression test for https://crbug.com/617435. 117 // Regression test for https://crbug.com/617435.
118 TEST_F(DownloadsApiUnitTest, ParseSearchQuery) { 118 TEST_F(DownloadsApiUnitTest, ParseSearchQuery) {
119 RunFunction(new DownloadsSearchFunction, "[{\"totalBytesLess\":1}]"); 119 RunFunction(new DownloadsSearchFunction, "[{\"totalBytesLess\":1}]");
120 RunFunction(new DownloadsSearchFunction, "[{\"totalBytesGreater\":2}]"); 120 RunFunction(new DownloadsSearchFunction, "[{\"totalBytesGreater\":2}]");
121 } 121 }
122 122
123 } // namespace extensions 123 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698