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

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

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 (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/strings/string_util.h" 5 #include "base/strings/string_util.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) { 60 IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) {
61 ASSERT_TRUE(test_server()->Start()); 61 ASSERT_TRUE(test_server()->Start());
62 62
63 // First we navigate to our test page (tab A). 63 // First we navigate to our test page (tab A).
64 GURL url = test_server()->GetURL(kSimplePage); 64 GURL url = test_server()->GetURL(kSimplePage);
65 ui_test_utils::NavigateToURL(browser(), url); 65 ui_test_utils::NavigateToURL(browser(), url);
66 66
67 chrome::Find(browser()); 67 chrome::Find(browser());
68 68
69 // Open another tab (tab B). 69 // Open another tab (tab B).
70 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); 70 chrome::AddSelectedTabWithURL(browser(), url, ui::PAGE_TRANSITION_TYPED);
71 71
72 chrome::Find(browser()); 72 chrome::Find(browser());
73 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), 73 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
74 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); 74 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD));
75 75
76 // Select tab A. 76 // Select tab A.
77 browser()->tab_strip_model()->ActivateTabAt(0, true); 77 browser()->tab_strip_model()->ActivateTabAt(0, true);
78 78
79 // Close tab B. 79 // Close tab B.
80 browser()->tab_strip_model()->CloseWebContentsAt(1, 80 browser()->tab_strip_model()->CloseWebContentsAt(1,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 177 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
178 browser(), ui::VKEY_LEFT, false, true, false, false)); 178 browser(), ui::VKEY_LEFT, false, true, false, false));
179 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 179 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
180 browser(), ui::VKEY_LEFT, false, true, false, false)); 180 browser(), ui::VKEY_LEFT, false, true, false, false));
181 EXPECT_EQ(ASCIIToUTF16("bc"), GetFindBarSelectedText()); 181 EXPECT_EQ(ASCIIToUTF16("bc"), GetFindBarSelectedText());
182 182
183 // Open another tab (tab B). 183 // Open another tab (tab B).
184 content::WindowedNotificationObserver observer( 184 content::WindowedNotificationObserver observer(
185 content::NOTIFICATION_LOAD_STOP, 185 content::NOTIFICATION_LOAD_STOP,
186 content::NotificationService::AllSources()); 186 content::NotificationService::AllSources());
187 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); 187 chrome::AddSelectedTabWithURL(browser(), url, ui::PAGE_TRANSITION_TYPED);
188 observer.Wait(); 188 observer.Wait();
189 189
190 // Show the Find bar. 190 // Show the Find bar.
191 browser()->GetFindBarController()->Show(); 191 browser()->GetFindBarController()->Show();
192 192
193 // Search for "def". 193 // Search for "def".
194 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 194 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
195 browser(), ui::VKEY_D, false, false, false, false)); 195 browser(), ui::VKEY_D, false, false, false, false));
196 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 196 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
197 browser(), ui::VKEY_E, false, false, false, false)); 197 browser(), ui::VKEY_E, false, false, false, false));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Search for 'a'. 243 // Search for 'a'.
244 ui_test_utils::FindInPage( 244 ui_test_utils::FindInPage(
245 browser()->tab_strip_model()->GetActiveWebContents(), 245 browser()->tab_strip_model()->GetActiveWebContents(),
246 ASCIIToUTF16("a"), true, false, NULL, NULL); 246 ASCIIToUTF16("a"), true, false, NULL, NULL);
247 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarSelectedText()); 247 EXPECT_EQ(ASCIIToUTF16("a"), GetFindBarSelectedText());
248 248
249 // Open another tab (tab B). 249 // Open another tab (tab B).
250 content::WindowedNotificationObserver observer( 250 content::WindowedNotificationObserver observer(
251 content::NOTIFICATION_LOAD_STOP, 251 content::NOTIFICATION_LOAD_STOP,
252 content::NotificationService::AllSources()); 252 content::NotificationService::AllSources());
253 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); 253 chrome::AddSelectedTabWithURL(browser(), url, ui::PAGE_TRANSITION_TYPED);
254 observer.Wait(); 254 observer.Wait();
255 255
256 // Make sure Find box is open. 256 // Make sure Find box is open.
257 chrome::Find(browser()); 257 chrome::Find(browser());
258 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), 258 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
259 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); 259 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD));
260 260
261 // Search for 'b'. 261 // Search for 'b'.
262 ui_test_utils::FindInPage( 262 ui_test_utils::FindInPage(
263 browser()->tab_strip_model()->GetActiveWebContents(), 263 browser()->tab_strip_model()->GetActiveWebContents(),
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 ui_test_utils::UrlLoadObserver observer( 436 ui_test_utils::UrlLoadObserver observer(
437 GURL("about:blank"), content::NotificationService::AllSources()); 437 GURL("about:blank"), content::NotificationService::AllSources());
438 438
439 // Send Ctrl-Enter, should cause navigation to about:blank. 439 // Send Ctrl-Enter, should cause navigation to about:blank.
440 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( 440 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
441 browser(), ui::VKEY_RETURN, true, false, false, false)); 441 browser(), ui::VKEY_RETURN, true, false, false, false));
442 442
443 observer.Wait(); 443 observer.Wait();
444 } 444 }
445 #endif 445 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698