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

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

Issue 11363124: Move DisplayManager and DisplayChangeObserverX11 from aura to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix rebase Created 8 years, 1 month 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/ash.gyp » ('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/caps_lock_delegate.h" 7 #include "ash/caps_lock_delegate.h"
8 #include "ash/display/multi_display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/ime_control_delegate.h" 9 #include "ash/ime_control_delegate.h"
10 #include "ash/screenshot_delegate.h" 10 #include "ash/screenshot_delegate.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
13 #include "ash/system/brightness/brightness_control_delegate.h" 13 #include "ash/system/brightness/brightness_control_delegate.h"
14 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" 14 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h"
15 #include "ash/system/tray/system_tray_delegate.h" 15 #include "ash/system/tray/system_tray_delegate.h"
16 #include "ash/test/ash_test_base.h" 16 #include "ash/test/ash_test_base.h"
17 #include "ash/test/test_shell_delegate.h" 17 #include "ash/test/test_shell_delegate.h"
18 #include "ash/volume_control_delegate.h" 18 #include "ash/volume_control_delegate.h"
19 #include "ash/wm/window_util.h" 19 #include "ash/wm/window_util.h"
20 #include "ui/aura/env.h"
21 #include "ui/aura/root_window.h" 20 #include "ui/aura/root_window.h"
22 #include "ui/aura/test/test_window_delegate.h" 21 #include "ui/aura/test/test_window_delegate.h"
23 #include "ui/aura/test/test_windows.h" 22 #include "ui/aura/test/test_windows.h"
24 #include "ui/aura/window.h" 23 #include "ui/aura/window.h"
25 #include "ui/base/events/event.h" 24 #include "ui/base/events/event.h"
26 25
27 #if defined(USE_X11) 26 #if defined(USE_X11)
28 #include <X11/Xlib.h> 27 #include <X11/Xlib.h>
29 #include "ui/base/x/x11_util.h" 28 #include "ui/base/x/x11_util.h"
30 #endif 29 #endif
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 306
308 } // namespace 307 } // namespace
309 308
310 class AcceleratorControllerTest : public test::AshTestBase { 309 class AcceleratorControllerTest : public test::AshTestBase {
311 public: 310 public:
312 AcceleratorControllerTest() {}; 311 AcceleratorControllerTest() {};
313 virtual ~AcceleratorControllerTest() {}; 312 virtual ~AcceleratorControllerTest() {};
314 313
315 protected: 314 protected:
316 void EnableInternalDisplay() { 315 void EnableInternalDisplay() {
317 static_cast<internal::MultiDisplayManager*>( 316 Shell::GetInstance()->display_manager()->
318 aura::Env::GetInstance()->display_manager())->
319 SetFirstDisplayAsInternalDisplayForTest(); 317 SetFirstDisplayAsInternalDisplayForTest();
320 } 318 }
321 319
322 static AcceleratorController* GetController(); 320 static AcceleratorController* GetController();
323 static bool ProcessWithContext(const ui::Accelerator& accelerator); 321 static bool ProcessWithContext(const ui::Accelerator& accelerator);
324 322
325 private: 323 private:
326 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest); 324 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest);
327 }; 325 };
328 326
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 EXPECT_EQ(f9, delegate->last_accelerator()); 1264 EXPECT_EQ(f9, delegate->last_accelerator());
1267 EXPECT_EQ(0, delegate->handle_volume_up_count()); 1265 EXPECT_EQ(0, delegate->handle_volume_up_count());
1268 EXPECT_TRUE(ProcessWithContext(f10)); 1266 EXPECT_TRUE(ProcessWithContext(f10));
1269 EXPECT_EQ(1, delegate->handle_volume_up_count()); 1267 EXPECT_EQ(1, delegate->handle_volume_up_count());
1270 EXPECT_EQ(f10, delegate->last_accelerator()); 1268 EXPECT_EQ(f10, delegate->last_accelerator());
1271 } 1269 }
1272 } 1270 }
1273 #endif 1271 #endif
1274 1272
1275 } // namespace ash 1273 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698