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

Side by Side Diff: chrome/browser/ui/views/find_bar_host_interactive_uitest.cc

Issue 11419276: Remove tabstrip wrappers in browser_tabstrip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 8 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) 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 "base/process_util.h" 5 #include "base/process_util.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/browser_tabstrip.h" 10 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 chrome::Find(browser()); 88 chrome::Find(browser());
89 89
90 // Open another tab (tab B). 90 // Open another tab (tab B).
91 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); 91 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED);
92 92
93 chrome::Find(browser()); 93 chrome::Find(browser());
94 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), 94 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
95 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); 95 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD));
96 96
97 // Select tab A. 97 // Select tab A.
98 chrome::ActivateTabAt(browser(), 0, true); 98 browser()->tab_strip_model()->ActivateTabAt(0, true);
99 99
100 // Close tab B. 100 // Close tab B.
101 chrome::CloseWebContents(browser(), chrome::GetWebContentsAt(browser(), 1)); 101 chrome::CloseWebContents(browser(), chrome::GetWebContentsAt(browser(), 1));
102 102
103 // Click on the location bar so that Find box loses focus. 103 // Click on the location bar so that Find box loses focus.
104 ASSERT_NO_FATAL_FAILURE(ui_test_utils::ClickOnView(browser(), 104 ASSERT_NO_FATAL_FAILURE(ui_test_utils::ClickOnView(browser(),
105 VIEW_ID_LOCATION_BAR)); 105 VIEW_ID_LOCATION_BAR));
106 // Check the location bar is focused. 106 // Check the location bar is focused.
107 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), 107 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
108 location_bar_focus_view_id_)); 108 location_bar_focus_view_id_));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 ui_test_utils::FindInPage(chrome::GetActiveWebContents(browser()), 203 ui_test_utils::FindInPage(chrome::GetActiveWebContents(browser()),
204 ASCIIToUTF16("b"), true, false, NULL, NULL); 204 ASCIIToUTF16("b"), true, false, NULL, NULL);
205 EXPECT_TRUE(ASCIIToUTF16("b") == find_bar->GetFindSelectedText()); 205 EXPECT_TRUE(ASCIIToUTF16("b") == find_bar->GetFindSelectedText());
206 206
207 // Set focus away from the Find bar (to the Location bar). 207 // Set focus away from the Find bar (to the Location bar).
208 chrome::FocusLocationBar(browser()); 208 chrome::FocusLocationBar(browser());
209 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), 209 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
210 location_bar_focus_view_id_)); 210 location_bar_focus_view_id_));
211 211
212 // Select tab A. Find bar should get focus. 212 // Select tab A. Find bar should get focus.
213 chrome::ActivateTabAt(browser(), 0, true); 213 browser()->tab_strip_model()->ActivateTabAt(0, true);
214 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), 214 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
215 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); 215 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD));
216 EXPECT_TRUE(ASCIIToUTF16("a") == find_bar->GetFindSelectedText()); 216 EXPECT_TRUE(ASCIIToUTF16("a") == find_bar->GetFindSelectedText());
217 217
218 // Select tab B. Location bar should get focus. 218 // Select tab B. Location bar should get focus.
219 chrome::ActivateTabAt(browser(), 1, true); 219 browser()->tab_strip_model()->ActivateTabAt(1, true);
220 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), 220 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
221 location_bar_focus_view_id_)); 221 location_bar_focus_view_id_));
222 } 222 }
223 223
224 // Flaky on XP: http://crbug.com/152100 224 // Flaky on XP: http://crbug.com/152100
225 #if defined(OS_WIN) 225 #if defined(OS_WIN)
226 #define MAYBE_PrepopulateRespectBlank DISABLED_PrepopulateRespectBlank 226 #define MAYBE_PrepopulateRespectBlank DISABLED_PrepopulateRespectBlank
227 #else 227 #else
228 #define MAYBE_PrepopulateRespectBlank PrepopulateRespectBlank 228 #define MAYBE_PrepopulateRespectBlank PrepopulateRespectBlank
229 #endif 229 #endif
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); 375 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source);
376 376
377 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 377 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
378 browser(), ui::VKEY_V, true, false, false, false)); 378 browser(), ui::VKEY_V, true, false, false, false));
379 379
380 ASSERT_NO_FATAL_FAILURE(observer.Wait()); 380 ASSERT_NO_FATAL_FAILURE(observer.Wait());
381 FindNotificationDetails details; 381 FindNotificationDetails details;
382 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); 382 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details));
383 EXPECT_TRUE(details.number_of_matches() > 0); 383 EXPECT_TRUE(details.number_of_matches() > 0);
384 } 384 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.cc ('k') | chrome/browser/ui/webui/bookmarks_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698