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

Side by Side Diff: ui/views/test/views_test_helper.h

Issue 2604303002: (Mac)Views: Widgets focus first View in traversal order if initial focus fails. (Closed)
Patch Set: Fix compile error. Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_VIEWS_TEST_VIEWS_TEST_HELPER_H_ 5 #ifndef UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_
6 #define UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_ 6 #define UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/gfx/native_widget_types.h" 9 #include "ui/gfx/native_widget_types.h"
10 10
11 namespace base { 11 namespace base {
12 class MessageLoopForUI; 12 class MessageLoopForUI;
13 } 13 }
14 14
15 namespace ui { 15 namespace ui {
16 class ContextFactory; 16 class ContextFactory;
17 class ContextFactoryPrivate; 17 class ContextFactoryPrivate;
18 } 18 }
19 19
20 namespace views { 20 namespace views {
21 21
22 class Widget;
23
22 // A helper class owned by tests that performs platform specific initialization 24 // A helper class owned by tests that performs platform specific initialization
23 // required for running tests. 25 // required for running tests.
24 class ViewsTestHelper { 26 class ViewsTestHelper {
25 public: 27 public:
26 ViewsTestHelper(); 28 ViewsTestHelper();
27 virtual ~ViewsTestHelper(); 29 virtual ~ViewsTestHelper();
28 30
29 // Create a platform specific instance. 31 // Create a platform specific instance.
30 static ViewsTestHelper* Create( 32 static ViewsTestHelper* Create(
31 base::MessageLoopForUI* message_loop, 33 base::MessageLoopForUI* message_loop,
32 ui::ContextFactory* context_factory, 34 ui::ContextFactory* context_factory,
33 ui::ContextFactoryPrivate* context_factory_private); 35 ui::ContextFactoryPrivate* context_factory_private);
34 36
35 // Creates objects that are needed for tests. 37 // Creates objects that are needed for tests.
36 virtual void SetUp(); 38 virtual void SetUp();
37 39
38 // Clean up objects that were created for tests. 40 // Clean up objects that were created for tests.
39 virtual void TearDown(); 41 virtual void TearDown();
40 42
41 // Returns a context view. In aura builds, this will be the 43 // Returns a context view. In aura builds, this will be the
42 // RootWindow. Everywhere else, NULL. 44 // RootWindow. Everywhere else, NULL.
43 virtual gfx::NativeWindow GetContext(); 45 virtual gfx::NativeWindow GetContext();
44 46
47 // Call this method to turn on full keyboard access for the given Widget. Note
48 // this is only used on Mac.
49 virtual void SetFullKeyboardAccessState(Widget* widget, bool new_state);
50
45 private: 51 private:
46 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelper); 52 DISALLOW_COPY_AND_ASSIGN(ViewsTestHelper);
47 }; 53 };
48 54
49 } // namespace views 55 } // namespace views
50 56
51 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_ 57 #endif // UI_VIEWS_TEST_VIEWS_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698