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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 PrefRegistrySimple* registry = 404 PrefRegistrySimple* registry =
405 drp_test_context_->pref_service()->registry(); 405 drp_test_context_->pref_service()->registry();
406 registry->RegisterDictionaryPref(proxy_config::prefs::kProxy); 406 registry->RegisterDictionaryPref(proxy_config::prefs::kProxy);
407 drp_test_context_->SetDataReductionProxyEnabled( 407 drp_test_context_->SetDataReductionProxyEnabled(
408 enable_data_reduction_proxy); 408 enable_data_reduction_proxy);
409 settings->set_data_reduction_proxy_enabled_pref_name_for_test( 409 settings->set_data_reduction_proxy_enabled_pref_name_for_test(
410 drp_test_context_->GetDataReductionProxyEnabledPrefName()); 410 drp_test_context_->GetDataReductionProxyEnabledPrefName());
411 settings->InitDataReductionProxySettings( 411 settings->InitDataReductionProxySettings(
412 drp_test_context_->io_data(), drp_test_context_->pref_service(), 412 drp_test_context_->io_data(), drp_test_context_->pref_service(),
413 drp_test_context_->request_context_getter(), 413 drp_test_context_->request_context_getter(),
414 base::WrapUnique(new data_reduction_proxy::DataStore()), 414 base::MakeUnique<data_reduction_proxy::DataStore>(),
415 base::ThreadTaskRunnerHandle::Get(), 415 base::ThreadTaskRunnerHandle::Get(),
416 base::ThreadTaskRunnerHandle::Get()); 416 base::ThreadTaskRunnerHandle::Get());
417 } 417 }
418 418
419 // Force destruction of |DataReductionProxySettings| so that objects on DB 419 // Force destruction of |DataReductionProxySettings| so that objects on DB
420 // task runner can be destroyed before test threads are destroyed. This method 420 // task runner can be destroyed before test threads are destroyed. This method
421 // must be called by tests that call |SetupDataReductionProxy|. We cannot 421 // must be called by tests that call |SetupDataReductionProxy|. We cannot
422 // destroy |drp_test_context_| until browser context keyed services are 422 // destroy |drp_test_context_| until browser context keyed services are
423 // destroyed since |DataReductionProxyChromeSettings| holds a pointer to the 423 // destroyed since |DataReductionProxyChromeSettings| holds a pointer to the
424 // |PrefService|, which is owned by |drp_test_context_|. 424 // |PrefService|, which is owned by |drp_test_context_|.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 params.unfiltered_link_url = params.link_url; 519 params.unfiltered_link_url = params.link_url;
520 content::WebContents* wc = web_contents(); 520 content::WebContents* wc = web_contents();
521 std::unique_ptr<TestRenderViewContextMenu> menu( 521 std::unique_ptr<TestRenderViewContextMenu> menu(
522 new TestRenderViewContextMenu(wc->GetMainFrame(), params)); 522 new TestRenderViewContextMenu(wc->GetMainFrame(), params));
523 AppendImageItems(menu.get()); 523 AppendImageItems(menu.get());
524 524
525 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE)); 525 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE));
526 526
527 DestroyDataReductionProxySettings(); 527 DestroyDataReductionProxySettings();
528 } 528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698