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

Side by Side Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 224113005: Eliminate ash::internal namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/accelerators/accelerator_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 #include "ash/accelerators/accelerator_table.h" 6 #include "ash/accelerators/accelerator_table.h"
7 #include "ash/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/ime_control_delegate.h" 10 #include "ash/ime_control_delegate.h"
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 EXPECT_NEAR(bounds.x() - work_area.x(), 539 EXPECT_NEAR(bounds.x() - work_area.x(),
540 work_area.right() - bounds.right(), 540 work_area.right() - bounds.right(),
541 1); 541 1);
542 EXPECT_NEAR(bounds.y() - work_area.y(), 542 EXPECT_NEAR(bounds.y() - work_area.y(),
543 work_area.bottom() - bounds.bottom(), 543 work_area.bottom() - bounds.bottom(),
544 1); 544 1);
545 545
546 // Add the window to docked container and try to center it. 546 // Add the window to docked container and try to center it.
547 window->SetBounds(gfx::Rect(0, 0, 20, 20)); 547 window->SetBounds(gfx::Rect(0, 0, 20, 20));
548 aura::Window* docked_container = Shell::GetContainer( 548 aura::Window* docked_container = Shell::GetContainer(
549 window->GetRootWindow(), internal::kShellWindowId_DockedContainer); 549 window->GetRootWindow(), kShellWindowId_DockedContainer);
550 docked_container->AddChild(window.get()); 550 docked_container->AddChild(window.get());
551 gfx::Rect docked_bounds = window->GetBoundsInScreen(); 551 gfx::Rect docked_bounds = window->GetBoundsInScreen();
552 GetController()->PerformAction(WINDOW_POSITION_CENTER, dummy); 552 GetController()->PerformAction(WINDOW_POSITION_CENTER, dummy);
553 // It should not get centered and should remain docked. 553 // It should not get centered and should remain docked.
554 EXPECT_EQ(internal::kShellWindowId_DockedContainer, window->parent()->id()); 554 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id());
555 EXPECT_EQ(docked_bounds.ToString(), window->GetBoundsInScreen().ToString()); 555 EXPECT_EQ(docked_bounds.ToString(), window->GetBoundsInScreen().ToString());
556 } 556 }
557 557
558 TEST_F(AcceleratorControllerTest, ControllerContext) { 558 TEST_F(AcceleratorControllerTest, ControllerContext) {
559 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE); 559 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE);
560 ui::Accelerator accelerator_a2(ui::VKEY_A, ui::EF_NONE); 560 ui::Accelerator accelerator_a2(ui::VKEY_A, ui::EF_NONE);
561 ui::Accelerator accelerator_b(ui::VKEY_B, ui::EF_NONE); 561 ui::Accelerator accelerator_b(ui::VKEY_B, ui::EF_NONE);
562 562
563 accelerator_a.set_type(ui::ET_KEY_PRESSED); 563 accelerator_a.set_type(ui::ET_KEY_PRESSED);
564 accelerator_a2.set_type(ui::ET_KEY_RELEASED); 564 accelerator_a2.set_type(ui::ET_KEY_RELEASED);
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 // Don't alert if we have a minimized window either. 1252 // Don't alert if we have a minimized window either.
1253 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); 1253 GetController()->PerformAction(WINDOW_MINIMIZE, dummy);
1254 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { 1254 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) {
1255 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); 1255 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE);
1256 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); 1256 GetController()->PerformAction(kActionsNeedingWindow[i], dummy);
1257 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); 1257 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE);
1258 } 1258 }
1259 } 1259 }
1260 1260
1261 } // namespace ash 1261 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/accelerators/accelerator_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698