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

Side by Side Diff: ui/aura/test/aura_test_helper.h

Issue 2207043002: SetDeviceScaleFactorForTest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetDeviceScaleFactorForTest Created 4 years, 4 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
« no previous file with comments | « ui/aura/demo/demo_main.cc ('k') | ui/aura/test/aura_test_helper.cc » ('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 #ifndef UI_AURA_TEST_AURA_TEST_HELPER_H_ 5 #ifndef UI_AURA_TEST_AURA_TEST_HELPER_H_
6 #define UI_AURA_TEST_AURA_TEST_HELPER_H_ 6 #define UI_AURA_TEST_AURA_TEST_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/aura/test/test_screen.h"
11 #include "ui/aura/window_event_dispatcher.h" 12 #include "ui/aura/window_event_dispatcher.h"
12 #include "ui/aura/window_tree_host.h" 13 #include "ui/aura/window_tree_host.h"
13 14
14 namespace aura { 15 namespace aura {
15 class Env; 16 class Env;
16 } 17 }
17 18
18 namespace base { 19 namespace base {
19 class MessageLoopForUI; 20 class MessageLoopForUI;
20 } 21 }
(...skipping 24 matching lines...) Expand all
45 // Creates and initializes (shows and sizes) the RootWindow for use in tests. 46 // Creates and initializes (shows and sizes) the RootWindow for use in tests.
46 void SetUp(ui::ContextFactory* context_factory); 47 void SetUp(ui::ContextFactory* context_factory);
47 48
48 // Clean up objects that are created for tests. This also deletes the Env 49 // Clean up objects that are created for tests. This also deletes the Env
49 // object. 50 // object.
50 void TearDown(); 51 void TearDown();
51 52
52 // Flushes message loop. 53 // Flushes message loop.
53 void RunAllPendingInMessageLoop(); 54 void RunAllPendingInMessageLoop();
54 55
55 Window* root_window() { return host_->window(); } 56 Window* root_window() { return host()->window(); }
56 ui::EventProcessor* event_processor() { return host_->event_processor(); } 57 ui::EventProcessor* event_processor() { return host()->event_processor(); }
57 WindowTreeHost* host() { return host_.get(); } 58 WindowTreeHost* host() { return test_screen_->host(); }
58 59
59 TestScreen* test_screen() { return test_screen_.get(); } 60 TestScreen* test_screen() { return test_screen_.get(); }
60 61
61 private: 62 private:
62 base::MessageLoopForUI* message_loop_; 63 base::MessageLoopForUI* message_loop_;
63 bool setup_called_; 64 bool setup_called_;
64 bool teardown_called_; 65 bool teardown_called_;
65 std::unique_ptr<aura::Env> env_; 66 std::unique_ptr<aura::Env> env_;
66 std::unique_ptr<WindowTreeHost> host_; 67 std::unique_ptr<WindowTreeHost> host_;
67 std::unique_ptr<TestWindowTreeClient> stacking_client_; 68 std::unique_ptr<TestWindowTreeClient> stacking_client_;
68 std::unique_ptr<client::DefaultCaptureClient> capture_client_; 69 std::unique_ptr<client::DefaultCaptureClient> capture_client_;
69 std::unique_ptr<client::FocusClient> focus_client_; 70 std::unique_ptr<client::FocusClient> focus_client_;
70 std::unique_ptr<TestScreen> test_screen_; 71 std::unique_ptr<TestScreen> test_screen_;
71 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; 72 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
72 73
73 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); 74 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper);
74 }; 75 };
75 76
76 } // namespace test 77 } // namespace test
77 } // namespace aura 78 } // namespace aura
78 79
79 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_ 80 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « ui/aura/demo/demo_main.cc ('k') | ui/aura/test/aura_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698