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

Side by Side Diff: chrome/browser/ui/panels/base_panel_browser_test.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/panels/base_panel_browser_test.h" 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // On a Mac, it transforms background-only test process into foreground one. 275 // On a Mac, it transforms background-only test process into foreground one.
276 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 276 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
277 } 277 }
278 278
279 void BasePanelBrowserTest::WaitForPanelActiveState( 279 void BasePanelBrowserTest::WaitForPanelActiveState(
280 Panel* panel, ActiveState expected_state) { 280 Panel* panel, ActiveState expected_state) {
281 DCHECK(expected_state == SHOW_AS_ACTIVE || 281 DCHECK(expected_state == SHOW_AS_ACTIVE ||
282 expected_state == SHOW_AS_INACTIVE); 282 expected_state == SHOW_AS_INACTIVE);
283 283
284 #if defined(OS_MACOSX) 284 #if defined(OS_MACOSX)
285 scoped_ptr<NativePanelTesting> panel_testing( 285 std::unique_ptr<NativePanelTesting> panel_testing(
286 CreateNativePanelTesting(panel)); 286 CreateNativePanelTesting(panel));
287 ASSERT_TRUE(panel_testing->EnsureApplicationRunOnForeground()) << 287 ASSERT_TRUE(panel_testing->EnsureApplicationRunOnForeground()) <<
288 "Failed to bring application to foreground. Bail out."; 288 "Failed to bring application to foreground. Bail out.";
289 #endif 289 #endif
290 290
291 PanelActiveStateObserver signal(panel, expected_state == SHOW_AS_ACTIVE); 291 PanelActiveStateObserver signal(panel, expected_state == SHOW_AS_ACTIVE);
292 signal.Wait(); 292 signal.Wait();
293 } 293 }
294 294
295 void BasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) { 295 void BasePanelBrowserTest::WaitForBoundsAnimationFinished(Panel* panel) {
296 scoped_ptr<NativePanelTesting> panel_testing( 296 std::unique_ptr<NativePanelTesting> panel_testing(
297 CreateNativePanelTesting(panel)); 297 CreateNativePanelTesting(panel));
298 // Sometimes there are several animations in sequence due to content 298 // Sometimes there are several animations in sequence due to content
299 // auto resizing. Wait for all animations to finish. 299 // auto resizing. Wait for all animations to finish.
300 while (panel_testing->IsAnimatingBounds()) { 300 while (panel_testing->IsAnimatingBounds()) {
301 content::WindowedNotificationObserver signal( 301 content::WindowedNotificationObserver signal(
302 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, 302 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED,
303 content::Source<Panel>(panel)); 303 content::Source<Panel>(panel));
304 if (!panel_testing->IsAnimatingBounds()) 304 if (!panel_testing->IsAnimatingBounds())
305 return; 305 return;
306 signal.Wait(); 306 signal.Wait();
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 } 517 }
518 518
519 scoped_refptr<Extension> BasePanelBrowserTest::CreateExtension( 519 scoped_refptr<Extension> BasePanelBrowserTest::CreateExtension(
520 const base::FilePath::StringType& path, 520 const base::FilePath::StringType& path,
521 extensions::Manifest::Location location, 521 extensions::Manifest::Location location,
522 const base::DictionaryValue& extra_value) { 522 const base::DictionaryValue& extra_value) {
523 extensions::ExtensionPrefs* extension_prefs = 523 extensions::ExtensionPrefs* extension_prefs =
524 extensions::ExtensionPrefs::Get(browser()->profile()); 524 extensions::ExtensionPrefs::Get(browser()->profile());
525 base::FilePath full_path = extension_prefs->install_directory().Append(path); 525 base::FilePath full_path = extension_prefs->install_directory().Append(path);
526 526
527 scoped_ptr<base::DictionaryValue> input_value(extra_value.DeepCopy()); 527 std::unique_ptr<base::DictionaryValue> input_value(extra_value.DeepCopy());
528 input_value->SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); 528 input_value->SetString(extensions::manifest_keys::kVersion, "1.0.0.0");
529 input_value->SetString(extensions::manifest_keys::kName, "Sample Extension"); 529 input_value->SetString(extensions::manifest_keys::kName, "Sample Extension");
530 530
531 std::string error; 531 std::string error;
532 scoped_refptr<Extension> extension = Extension::Create( 532 scoped_refptr<Extension> extension = Extension::Create(
533 full_path, location, *input_value, Extension::NO_FLAGS, &error); 533 full_path, location, *input_value, Extension::NO_FLAGS, &error);
534 EXPECT_TRUE(extension.get()); 534 EXPECT_TRUE(extension.get());
535 EXPECT_STREQ("", error.c_str()); 535 EXPECT_STREQ("", error.c_str());
536 extensions::ExtensionSystem::Get( 536 extensions::ExtensionSystem::Get(
537 browser()->profile())->extension_service()->OnExtensionInstalled( 537 browser()->profile())->extension_service()->OnExtensionInstalled(
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 } 581 }
582 582
583 std::string BasePanelBrowserTest::MakePanelName(int index) { 583 std::string BasePanelBrowserTest::MakePanelName(int index) {
584 std::string panel_name("Panel"); 584 std::string panel_name("Panel");
585 return panel_name + base::IntToString(index); 585 return panel_name + base::IntToString(index);
586 } 586 }
587 587
588 bool BasePanelBrowserTest::WmSupportWindowActivation() { 588 bool BasePanelBrowserTest::WmSupportWindowActivation() {
589 return true; 589 return true;
590 } 590 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view_browsertest.cc ('k') | chrome/browser/ui/panels/detached_panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698