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

Side by Side Diff: chrome/browser/browser_focus_uitest.cc

Issue 5856001: Cleanup: USE_X11 + OS_MACOSX = OS_POSIX. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 Source<RenderViewHost>(render_view_host()), 171 Source<RenderViewHost>(render_view_host()),
172 Details<const bool>(&is_editable_node)); 172 Details<const bool>(&is_editable_node));
173 } 173 }
174 174
175 private: 175 private:
176 std::string html_contents_; 176 std::string html_contents_;
177 }; 177 };
178 178
179 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, ClickingMovesFocus) { 179 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, ClickingMovesFocus) {
180 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 180 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
181 #if defined(USE_X11) || defined(OS_MACOSX) 181 #if defined(OS_POSIX)
182 // It seems we have to wait a little bit for the widgets to spin up before 182 // It seems we have to wait a little bit for the widgets to spin up before
183 // we can start clicking on them. 183 // we can start clicking on them.
184 MessageLoop::current()->PostDelayedTask(FROM_HERE, 184 MessageLoop::current()->PostDelayedTask(FROM_HERE,
185 new MessageLoop::QuitTask(), 185 new MessageLoop::QuitTask(),
186 kActionDelayMs); 186 kActionDelayMs);
187 ui_test_utils::RunMessageLoop(); 187 ui_test_utils::RunMessageLoop();
188 #endif 188 #endif // defined(OS_POSIX)
189 189
190 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); 190 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
191 191
192 ClickOnView(VIEW_ID_TAB_CONTAINER); 192 ClickOnView(VIEW_ID_TAB_CONTAINER);
193 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); 193 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW));
194 194
195 ClickOnView(VIEW_ID_LOCATION_BAR); 195 ClickOnView(VIEW_ID_LOCATION_BAR);
196 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); 196 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
197 } 197 }
198 198
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); 833 ui_test_utils::CrashTab(browser()->GetSelectedTabContents());
834 browser()->Reload(CURRENT_TAB); 834 browser()->Reload(CURRENT_TAB);
835 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); 835 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
836 836
837 // Focus should now be on the tab contents. 837 // Focus should now be on the tab contents.
838 browser()->ShowDownloadsTab(); 838 browser()->ShowDownloadsTab();
839 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); 839 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW));
840 } 840 }
841 841
842 } // namespace 842 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698