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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_browsertest.cc

Issue 2257103002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/policy/device_local_account.h" 5 #include "chrome/browser/chromeos/policy/device_local_account.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 387
388 std::unique_ptr<net::FakeURLFetcher> RunCallbackAndReturnFakeURLFetcher( 388 std::unique_ptr<net::FakeURLFetcher> RunCallbackAndReturnFakeURLFetcher(
389 scoped_refptr<base::SequencedTaskRunner> task_runner, 389 scoped_refptr<base::SequencedTaskRunner> task_runner,
390 const base::Closure& callback, 390 const base::Closure& callback,
391 const GURL& url, 391 const GURL& url,
392 net::URLFetcherDelegate* delegate, 392 net::URLFetcherDelegate* delegate,
393 const std::string& response_data, 393 const std::string& response_data,
394 net::HttpStatusCode response_code, 394 net::HttpStatusCode response_code,
395 net::URLRequestStatus::Status status) { 395 net::URLRequestStatus::Status status) {
396 task_runner->PostTask(FROM_HERE, callback); 396 task_runner->PostTask(FROM_HERE, callback);
397 return base::WrapUnique(new net::FakeURLFetcher(url, delegate, response_data, 397 return base::MakeUnique<net::FakeURLFetcher>(url, delegate, response_data,
398 response_code, status)); 398 response_code, status);
399 } 399 }
400 400
401 bool IsSessionStarted() { 401 bool IsSessionStarted() {
402 return user_manager::UserManager::Get()->IsSessionStarted(); 402 return user_manager::UserManager::Get()->IsSessionStarted();
403 } 403 }
404 404
405 void PolicyChangedCallback(const base::Closure& callback, 405 void PolicyChangedCallback(const base::Closure& callback,
406 const base::Value* old_value, 406 const base::Value* old_value,
407 const base::Value* new_value) { 407 const base::Value* new_value) {
408 callback.Run(); 408 callback.Run();
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 base::Bind(&TestingUpdateManifestProvider::HandleRequest, 1265 base::Bind(&TestingUpdateManifestProvider::HandleRequest,
1266 testing_update_manifest_provider)); 1266 testing_update_manifest_provider));
1267 // Create and initialize local cache. 1267 // Create and initialize local cache.
1268 base::ScopedTempDir cache_dir; 1268 base::ScopedTempDir cache_dir;
1269 EXPECT_TRUE(cache_dir.CreateUniqueTempDir()); 1269 EXPECT_TRUE(cache_dir.CreateUniqueTempDir());
1270 const base::FilePath impl_path = cache_dir.path(); 1270 const base::FilePath impl_path = cache_dir.path();
1271 EXPECT_TRUE(base::CreateDirectory(impl_path)); 1271 EXPECT_TRUE(base::CreateDirectory(impl_path));
1272 CreateFile(impl_path.Append( 1272 CreateFile(impl_path.Append(
1273 extensions::LocalExtensionCache::kCacheReadyFlagFileName), 1273 extensions::LocalExtensionCache::kCacheReadyFlagFileName),
1274 0, base::Time::Now()); 1274 0, base::Time::Now());
1275 extensions::ExtensionCacheImpl cache_impl(base::WrapUnique( 1275 extensions::ExtensionCacheImpl cache_impl(
1276 new extensions::ChromeOSExtensionCacheDelegate(impl_path))); 1276 base::MakeUnique<extensions::ChromeOSExtensionCacheDelegate>(impl_path));
1277 std::unique_ptr<base::RunLoop> run_loop; 1277 std::unique_ptr<base::RunLoop> run_loop;
1278 run_loop.reset(new base::RunLoop); 1278 run_loop.reset(new base::RunLoop);
1279 cache_impl.Start(base::Bind(&OnExtensionCacheImplInitialized, &run_loop)); 1279 cache_impl.Start(base::Bind(&OnExtensionCacheImplInitialized, &run_loop));
1280 run_loop->Run(); 1280 run_loop->Run();
1281 1281
1282 // Put extension in the local cache. 1282 // Put extension in the local cache.
1283 base::ScopedTempDir temp_dir; 1283 base::ScopedTempDir temp_dir;
1284 EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); 1284 EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
1285 const base::FilePath temp_path = temp_dir.path(); 1285 const base::FilePath temp_path = temp_dir.path();
1286 EXPECT_TRUE(base::CreateDirectory(temp_path)); 1286 EXPECT_TRUE(base::CreateDirectory(temp_path));
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 ASSERT_TRUE(content::ExecuteScript(contents_, 2444 ASSERT_TRUE(content::ExecuteScript(contents_,
2445 "$('tos-accept-button').click();")); 2445 "$('tos-accept-button').click();"));
2446 2446
2447 WaitForSessionStart(); 2447 WaitForSessionStart();
2448 } 2448 }
2449 2449
2450 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance, 2450 INSTANTIATE_TEST_CASE_P(TermsOfServiceDownloadTestInstance,
2451 TermsOfServiceDownloadTest, testing::Bool()); 2451 TermsOfServiceDownloadTest, testing::Bool());
2452 2452
2453 } // namespace policy 2453 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698