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

Side by Side Diff: chrome/browser/ui/panels/stacked_panel_browsertest.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) 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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/panels/base_panel_browser_test.h" 7 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
8 #include "chrome/browser/ui/panels/detached_panel_collection.h" 8 #include "chrome/browser/ui/panels/detached_panel_collection.h"
9 #include "chrome/browser/ui/panels/docked_panel_collection.h" 9 #include "chrome/browser/ui/panels/docked_panel_collection.h"
10 #include "chrome/browser/ui/panels/native_panel.h" 10 #include "chrome/browser/ui/panels/native_panel.h"
(...skipping 12 matching lines...) Expand all
23 23
24 // Create 2 stacked panels. 24 // Create 2 stacked panels.
25 StackedPanelCollection* stack = panel_manager->CreateStack(); 25 StackedPanelCollection* stack = panel_manager->CreateStack();
26 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150); 26 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150);
27 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack); 27 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack);
28 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100); 28 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100);
29 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack); 29 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack);
30 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 120, 110); 30 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 120, 110);
31 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack); 31 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack);
32 32
33 scoped_ptr<NativePanelTesting> panel1_testing( 33 std::unique_ptr<NativePanelTesting> panel1_testing(
34 CreateNativePanelTesting(panel1)); 34 CreateNativePanelTesting(panel1));
35 scoped_ptr<NativePanelTesting> panel2_testing( 35 std::unique_ptr<NativePanelTesting> panel2_testing(
36 CreateNativePanelTesting(panel2)); 36 CreateNativePanelTesting(panel2));
37 scoped_ptr<NativePanelTesting> panel3_testing( 37 std::unique_ptr<NativePanelTesting> panel3_testing(
38 CreateNativePanelTesting(panel3)); 38 CreateNativePanelTesting(panel3));
39 39
40 // Check that all 3 panels are in a stack. 40 // Check that all 3 panels are in a stack.
41 ASSERT_EQ(0, panel_manager->docked_collection()->num_panels()); 41 ASSERT_EQ(0, panel_manager->docked_collection()->num_panels());
42 ASSERT_EQ(0, panel_manager->detached_collection()->num_panels()); 42 ASSERT_EQ(0, panel_manager->detached_collection()->num_panels());
43 ASSERT_EQ(1, panel_manager->num_stacks()); 43 ASSERT_EQ(1, panel_manager->num_stacks());
44 ASSERT_EQ(3, stack->num_panels()); 44 ASSERT_EQ(3, stack->num_panels());
45 EXPECT_EQ(stack, panel1->stack()); 45 EXPECT_EQ(stack, panel1->stack());
46 EXPECT_EQ(stack, panel2->stack()); 46 EXPECT_EQ(stack, panel2->stack());
47 EXPECT_EQ(stack, panel3->stack()); 47 EXPECT_EQ(stack, panel3->stack());
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // Create 2 stacked panels. 118 // Create 2 stacked panels.
119 StackedPanelCollection* stack = panel_manager->CreateStack(); 119 StackedPanelCollection* stack = panel_manager->CreateStack();
120 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150); 120 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150);
121 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack); 121 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack);
122 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100); 122 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100);
123 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack); 123 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack);
124 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 120, 110); 124 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 120, 110);
125 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack); 125 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack);
126 126
127 scoped_ptr<NativePanelTesting> panel1_testing( 127 std::unique_ptr<NativePanelTesting> panel1_testing(
128 CreateNativePanelTesting(panel1)); 128 CreateNativePanelTesting(panel1));
129 scoped_ptr<NativePanelTesting> panel2_testing( 129 std::unique_ptr<NativePanelTesting> panel2_testing(
130 CreateNativePanelTesting(panel2)); 130 CreateNativePanelTesting(panel2));
131 scoped_ptr<NativePanelTesting> panel3_testing( 131 std::unique_ptr<NativePanelTesting> panel3_testing(
132 CreateNativePanelTesting(panel3)); 132 CreateNativePanelTesting(panel3));
133 133
134 // Minimize these 2 panels. 134 // Minimize these 2 panels.
135 panel1->Minimize(); 135 panel1->Minimize();
136 WaitForBoundsAnimationFinished(panel1); 136 WaitForBoundsAnimationFinished(panel1);
137 panel2->Minimize(); 137 panel2->Minimize();
138 WaitForBoundsAnimationFinished(panel2); 138 WaitForBoundsAnimationFinished(panel2);
139 panel3->Minimize(); 139 panel3->Minimize();
140 WaitForBoundsAnimationFinished(panel3); 140 WaitForBoundsAnimationFinished(panel3);
141 141
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 PanelManager* panel_manager = PanelManager::GetInstance(); 213 PanelManager* panel_manager = PanelManager::GetInstance();
214 214
215 // Create 2 stacked panels. 215 // Create 2 stacked panels.
216 StackedPanelCollection* stack = panel_manager->CreateStack(); 216 StackedPanelCollection* stack = panel_manager->CreateStack();
217 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150); 217 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150);
218 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack); 218 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack);
219 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100); 219 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100);
220 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack); 220 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack);
221 ASSERT_EQ(1, panel_manager->num_stacks()); 221 ASSERT_EQ(1, panel_manager->num_stacks());
222 222
223 scoped_ptr<NativePanelTesting> panel1_testing( 223 std::unique_ptr<NativePanelTesting> panel1_testing(
224 CreateNativePanelTesting(panel1)); 224 CreateNativePanelTesting(panel1));
225 scoped_ptr<NativePanelTesting> panel2_testing( 225 std::unique_ptr<NativePanelTesting> panel2_testing(
226 CreateNativePanelTesting(panel2)); 226 CreateNativePanelTesting(panel2));
227 227
228 gfx::Point panel1_origin = panel2->GetBounds().origin(); 228 gfx::Point panel1_origin = panel2->GetBounds().origin();
229 gfx::Point panel2_origin = panel2->GetBounds().origin(); 229 gfx::Point panel2_origin = panel2->GetBounds().origin();
230 230
231 EXPECT_FALSE(panel1->IsMinimized()); 231 EXPECT_FALSE(panel1->IsMinimized());
232 EXPECT_FALSE(panel2->IsMinimized()); 232 EXPECT_FALSE(panel2->IsMinimized());
233 233
234 gfx::Rect panel1_expected_bounds(panel1_initial_bounds); 234 gfx::Rect panel1_expected_bounds(panel1_initial_bounds);
235 EXPECT_EQ(panel1_expected_bounds, panel1->GetBounds()); 235 EXPECT_EQ(panel1_expected_bounds, panel1->GetBounds());
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 gfx::Rect work_area = 449 gfx::Rect work_area =
450 panel_manager->display_settings_provider()->GetPrimaryWorkArea(); 450 panel_manager->display_settings_provider()->GetPrimaryWorkArea();
451 451
452 // Create 3 stacked panels. 452 // Create 3 stacked panels.
453 StackedPanelCollection* stack = panel_manager->CreateStack(); 453 StackedPanelCollection* stack = panel_manager->CreateStack();
454 Panel* panel1 = CreateStackedPanel("1", gfx::Rect(100, 150, 200, 200), stack); 454 Panel* panel1 = CreateStackedPanel("1", gfx::Rect(100, 150, 200, 200), stack);
455 Panel* panel2 = CreateStackedPanel("2", gfx::Rect(0, 0, 150, 100), stack); 455 Panel* panel2 = CreateStackedPanel("2", gfx::Rect(0, 0, 150, 100), stack);
456 Panel* panel3 = CreateStackedPanel("3", gfx::Rect(0, 0, 150, 120), stack); 456 Panel* panel3 = CreateStackedPanel("3", gfx::Rect(0, 0, 150, 120), stack);
457 ASSERT_EQ(3, stack->num_panels()); 457 ASSERT_EQ(3, stack->num_panels());
458 458
459 scoped_ptr<NativePanelTesting> panel2_testing( 459 std::unique_ptr<NativePanelTesting> panel2_testing(
460 CreateNativePanelTesting(panel2)); 460 CreateNativePanelTesting(panel2));
461 461
462 // Collapse all panels by clicking on P2's titlebar with APPLY_TO_ALL 462 // Collapse all panels by clicking on P2's titlebar with APPLY_TO_ALL
463 // modifier. 463 // modifier.
464 panel2_testing->PressLeftMouseButtonTitlebar(panel2->GetBounds().origin(), 464 panel2_testing->PressLeftMouseButtonTitlebar(panel2->GetBounds().origin(),
465 panel::APPLY_TO_ALL); 465 panel::APPLY_TO_ALL);
466 panel2_testing->ReleaseMouseButtonTitlebar(panel::APPLY_TO_ALL); 466 panel2_testing->ReleaseMouseButtonTitlebar(panel::APPLY_TO_ALL);
467 WaitForBoundsAnimationFinished(panel1); 467 WaitForBoundsAnimationFinished(panel1);
468 WaitForBoundsAnimationFinished(panel2); 468 WaitForBoundsAnimationFinished(panel2);
469 WaitForBoundsAnimationFinished(panel3); 469 WaitForBoundsAnimationFinished(panel3);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 StackedPanelCollection* stack = panel_manager->CreateStack(); 501 StackedPanelCollection* stack = panel_manager->CreateStack();
502 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150); 502 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150);
503 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack); 503 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack);
504 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100); 504 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100);
505 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack); 505 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack);
506 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 250, 120); 506 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 250, 120);
507 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack); 507 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack);
508 ASSERT_EQ(1, panel_manager->num_stacks()); 508 ASSERT_EQ(1, panel_manager->num_stacks());
509 ASSERT_EQ(3, stack->num_panels()); 509 ASSERT_EQ(3, stack->num_panels());
510 510
511 scoped_ptr<NativePanelTesting> panel1_testing( 511 std::unique_ptr<NativePanelTesting> panel1_testing(
512 CreateNativePanelTesting(panel1)); 512 CreateNativePanelTesting(panel1));
513 scoped_ptr<NativePanelTesting> panel2_testing( 513 std::unique_ptr<NativePanelTesting> panel2_testing(
514 CreateNativePanelTesting(panel2)); 514 CreateNativePanelTesting(panel2));
515 scoped_ptr<NativePanelTesting> panel3_testing( 515 std::unique_ptr<NativePanelTesting> panel3_testing(
516 CreateNativePanelTesting(panel3)); 516 CreateNativePanelTesting(panel3));
517 517
518 // Only P1 shows minimize button. 518 // Only P1 shows minimize button.
519 if (PanelManager::CanUseSystemMinimize()) 519 if (PanelManager::CanUseSystemMinimize())
520 EXPECT_TRUE(panel1_testing->IsButtonVisible(panel::MINIMIZE_BUTTON)); 520 EXPECT_TRUE(panel1_testing->IsButtonVisible(panel::MINIMIZE_BUTTON));
521 else 521 else
522 EXPECT_FALSE(panel1_testing->IsButtonVisible(panel::MINIMIZE_BUTTON)); 522 EXPECT_FALSE(panel1_testing->IsButtonVisible(panel::MINIMIZE_BUTTON));
523 EXPECT_FALSE(panel2_testing->IsButtonVisible(panel::MINIMIZE_BUTTON)); 523 EXPECT_FALSE(panel2_testing->IsButtonVisible(panel::MINIMIZE_BUTTON));
524 EXPECT_FALSE(panel3_testing->IsButtonVisible(panel::MINIMIZE_BUTTON)); 524 EXPECT_FALSE(panel3_testing->IsButtonVisible(panel::MINIMIZE_BUTTON));
525 525
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 PanelManager* panel_manager = PanelManager::GetInstance(); 573 PanelManager* panel_manager = PanelManager::GetInstance();
574 574
575 // Create 2 stacked panels. 575 // Create 2 stacked panels.
576 StackedPanelCollection* stack = panel_manager->CreateStack(); 576 StackedPanelCollection* stack = panel_manager->CreateStack();
577 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150); 577 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150);
578 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack); 578 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack);
579 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100); 579 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100);
580 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack); 580 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack);
581 ASSERT_EQ(1, panel_manager->num_stacks()); 581 ASSERT_EQ(1, panel_manager->num_stacks());
582 582
583 scoped_ptr<NativePanelTesting> panel1_testing( 583 std::unique_ptr<NativePanelTesting> panel1_testing(
584 CreateNativePanelTesting(panel1)); 584 CreateNativePanelTesting(panel1));
585 585
586 EXPECT_FALSE(panel1->IsMinimized()); 586 EXPECT_FALSE(panel1->IsMinimized());
587 EXPECT_FALSE(panel2->IsMinimized()); 587 EXPECT_FALSE(panel2->IsMinimized());
588 588
589 // Collapsing P1 by calling its Minimize API. 589 // Collapsing P1 by calling its Minimize API.
590 panel1->OnMinimizeButtonClicked(panel::NO_MODIFIER); 590 panel1->OnMinimizeButtonClicked(panel::NO_MODIFIER);
591 EXPECT_FALSE(panel1->IsMinimized()); 591 EXPECT_FALSE(panel1->IsMinimized());
592 EXPECT_FALSE(panel2->IsMinimized()); 592 EXPECT_FALSE(panel2->IsMinimized());
593 EXPECT_TRUE(panel1_testing->VerifySystemMinimizeState()); 593 EXPECT_TRUE(panel1_testing->VerifySystemMinimizeState());
594 594
595 panel_manager->CloseAll(); 595 panel_manager->CloseAll();
596 } 596 }
597 597
598 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest, UngroupMinimizedPanels) { 598 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest, UngroupMinimizedPanels) {
599 PanelManager* panel_manager = PanelManager::GetInstance(); 599 PanelManager* panel_manager = PanelManager::GetInstance();
600 600
601 // Create 3 stacked panels. 601 // Create 3 stacked panels.
602 StackedPanelCollection* stack = panel_manager->CreateStack(); 602 StackedPanelCollection* stack = panel_manager->CreateStack();
603 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150); 603 gfx::Rect panel1_initial_bounds = gfx::Rect(100, 50, 200, 150);
604 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack); 604 Panel* panel1 = CreateStackedPanel("1", panel1_initial_bounds, stack);
605 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100); 605 gfx::Rect panel2_initial_bounds = gfx::Rect(0, 0, 150, 100);
606 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack); 606 Panel* panel2 = CreateStackedPanel("2", panel2_initial_bounds, stack);
607 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 250, 120); 607 gfx::Rect panel3_initial_bounds = gfx::Rect(0, 0, 250, 120);
608 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack); 608 Panel* panel3 = CreateStackedPanel("3", panel3_initial_bounds, stack);
609 ASSERT_EQ(1, panel_manager->num_stacks()); 609 ASSERT_EQ(1, panel_manager->num_stacks());
610 ASSERT_EQ(3, stack->num_panels()); 610 ASSERT_EQ(3, stack->num_panels());
611 611
612 scoped_ptr<NativePanelTesting> panel2_testing( 612 std::unique_ptr<NativePanelTesting> panel2_testing(
613 CreateNativePanelTesting(panel2)); 613 CreateNativePanelTesting(panel2));
614 scoped_ptr<NativePanelTesting> panel3_testing( 614 std::unique_ptr<NativePanelTesting> panel3_testing(
615 CreateNativePanelTesting(panel3)); 615 CreateNativePanelTesting(panel3));
616 616
617 // Minimize these 3 panels. 617 // Minimize these 3 panels.
618 panel1->Minimize(); 618 panel1->Minimize();
619 WaitForBoundsAnimationFinished(panel1); 619 WaitForBoundsAnimationFinished(panel1);
620 panel2->Minimize(); 620 panel2->Minimize();
621 WaitForBoundsAnimationFinished(panel3); 621 WaitForBoundsAnimationFinished(panel3);
622 panel3->Minimize(); 622 panel3->Minimize();
623 WaitForBoundsAnimationFinished(panel3); 623 WaitForBoundsAnimationFinished(panel3);
624 624
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 1042
1043 panel_manager->CloseAll(); 1043 panel_manager->CloseAll();
1044 } 1044 }
1045 1045
1046 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest, 1046 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest,
1047 AddNewPanelFromDifferentProfile) { 1047 AddNewPanelFromDifferentProfile) {
1048 PanelManager* panel_manager = PanelManager::GetInstance(); 1048 PanelManager* panel_manager = PanelManager::GetInstance();
1049 1049
1050 // Create a new profile. 1050 // Create a new profile.
1051 Profile* profile1 = browser()->profile(); 1051 Profile* profile1 = browser()->profile();
1052 scoped_ptr<TestingProfile> profile2(new TestingProfile()); 1052 std::unique_ptr<TestingProfile> profile2(new TestingProfile());
1053 1053
1054 // Create 2 panels from profile1. Expect that these 2 panels stack together. 1054 // Create 2 panels from profile1. Expect that these 2 panels stack together.
1055 CreatePanelParams params1( 1055 CreatePanelParams params1(
1056 "1", gfx::Rect(50, 50, 100, 100), SHOW_AS_ACTIVE); 1056 "1", gfx::Rect(50, 50, 100, 100), SHOW_AS_ACTIVE);
1057 params1.create_mode = PanelManager::CREATE_AS_DETACHED; 1057 params1.create_mode = PanelManager::CREATE_AS_DETACHED;
1058 params1.profile = profile1; 1058 params1.profile = profile1;
1059 Panel* panel1 = CreatePanelWithParams(params1); 1059 Panel* panel1 = CreatePanelWithParams(params1);
1060 CreatePanelParams params2( 1060 CreatePanelParams params2(
1061 "2", gfx::Rect(100, 100, 200, 100), SHOW_AS_ACTIVE); 1061 "2", gfx::Rect(100, 100, 200, 100), SHOW_AS_ACTIVE);
1062 params2.create_mode = PanelManager::CREATE_AS_DETACHED; 1062 params2.create_mode = PanelManager::CREATE_AS_DETACHED;
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 } 1438 }
1439 1439
1440 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest, 1440 IN_PROC_BROWSER_TEST_F(StackedPanelBrowserTest,
1441 KeepShowingStackedPanelCreatedBeforeFullScreenMode) { 1441 KeepShowingStackedPanelCreatedBeforeFullScreenMode) {
1442 PanelManager* panel_manager = PanelManager::GetInstance(); 1442 PanelManager* panel_manager = PanelManager::GetInstance();
1443 1443
1444 // Create 2 stacked panels. 1444 // Create 2 stacked panels.
1445 StackedPanelCollection* stack = panel_manager->CreateStack(); 1445 StackedPanelCollection* stack = panel_manager->CreateStack();
1446 Panel* panel1 = CreateStackedPanel("1", gfx::Rect(100, 50, 200, 150), stack); 1446 Panel* panel1 = CreateStackedPanel("1", gfx::Rect(100, 50, 200, 150), stack);
1447 Panel* panel2 = CreateStackedPanel("2", gfx::Rect(0, 0, 150, 100), stack); 1447 Panel* panel2 = CreateStackedPanel("2", gfx::Rect(0, 0, 150, 100), stack);
1448 scoped_ptr<NativePanelTesting> panel1_testing( 1448 std::unique_ptr<NativePanelTesting> panel1_testing(
1449 CreateNativePanelTesting(panel1)); 1449 CreateNativePanelTesting(panel1));
1450 scoped_ptr<NativePanelTesting> panel2_testing( 1450 std::unique_ptr<NativePanelTesting> panel2_testing(
1451 CreateNativePanelTesting(panel2)); 1451 CreateNativePanelTesting(panel2));
1452 1452
1453 // Panels should be visible at first. 1453 // Panels should be visible at first.
1454 EXPECT_TRUE(panel1_testing->IsWindowVisible()); 1454 EXPECT_TRUE(panel1_testing->IsWindowVisible());
1455 EXPECT_TRUE(panel2_testing->IsWindowVisible()); 1455 EXPECT_TRUE(panel2_testing->IsWindowVisible());
1456 1456
1457 // Panels' visibility should not be affected when entering full-screen mode. 1457 // Panels' visibility should not be affected when entering full-screen mode.
1458 mock_display_settings_provider()->EnableFullScreenMode(true); 1458 mock_display_settings_provider()->EnableFullScreenMode(true);
1459 EXPECT_TRUE(panel1_testing->IsWindowVisible()); 1459 EXPECT_TRUE(panel1_testing->IsWindowVisible());
1460 EXPECT_TRUE(panel2_testing->IsWindowVisible()); 1460 EXPECT_TRUE(panel2_testing->IsWindowVisible());
1461 1461
1462 // Panels' visibility should not be affected when leaving full-screen mode. 1462 // Panels' visibility should not be affected when leaving full-screen mode.
1463 mock_display_settings_provider()->EnableFullScreenMode(false); 1463 mock_display_settings_provider()->EnableFullScreenMode(false);
1464 EXPECT_TRUE(panel1_testing->IsWindowVisible()); 1464 EXPECT_TRUE(panel1_testing->IsWindowVisible());
1465 EXPECT_TRUE(panel2_testing->IsWindowVisible()); 1465 EXPECT_TRUE(panel2_testing->IsWindowVisible());
1466 1466
1467 panel_manager->CloseAll(); 1467 panel_manager->CloseAll();
1468 } 1468 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_mouse_watcher_unittest.cc ('k') | chrome/browser/ui/passwords/manage_passwords_bubble_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698