OLD | NEW |
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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 }; | 153 }; |
154 | 154 |
155 class BrowserFocusTest : public InProcessBrowserTest { | 155 class BrowserFocusTest : public InProcessBrowserTest { |
156 public: | 156 public: |
157 BrowserFocusTest() : | 157 BrowserFocusTest() : |
158 #if defined(USE_AURA) | 158 #if defined(USE_AURA) |
159 location_bar_focus_view_id_(VIEW_ID_OMNIBOX) | 159 location_bar_focus_view_id_(VIEW_ID_OMNIBOX) |
160 #else | 160 #else |
161 location_bar_focus_view_id_(VIEW_ID_LOCATION_BAR) | 161 location_bar_focus_view_id_(VIEW_ID_LOCATION_BAR) |
162 #endif | 162 #endif |
163 { | 163 {} |
164 EnableDOMAutomation(); | |
165 } | |
166 | 164 |
167 bool IsViewFocused(ViewID vid) { | 165 bool IsViewFocused(ViewID vid) { |
168 return ui_test_utils::IsViewFocused(browser(), vid); | 166 return ui_test_utils::IsViewFocused(browser(), vid); |
169 } | 167 } |
170 | 168 |
171 void ClickOnView(ViewID vid) { | 169 void ClickOnView(ViewID vid) { |
172 ui_test_utils::ClickOnView(browser(), vid); | 170 ui_test_utils::ClickOnView(browser(), vid); |
173 } | 171 } |
174 | 172 |
175 bool WaitForFocusChange(ViewID vid) { | 173 bool WaitForFocusChange(ViewID vid) { |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 chrome::Reload(browser(), CURRENT_TAB); | 925 chrome::Reload(browser(), CURRENT_TAB); |
928 observer.Wait(); | 926 observer.Wait(); |
929 } | 927 } |
930 | 928 |
931 // Focus should now be on the tab contents. | 929 // Focus should now be on the tab contents. |
932 chrome::ShowDownloads(browser()); | 930 chrome::ShowDownloads(browser()); |
933 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 931 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
934 } | 932 } |
935 | 933 |
936 } // namespace | 934 } // namespace |
OLD | NEW |