| 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 "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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 FindBarTesting* find_bar = | 180 FindBarTesting* find_bar = |
| 181 browser()->GetFindBarController()->find_bar()->GetFindBarTesting(); | 181 browser()->GetFindBarController()->find_bar()->GetFindBarTesting(); |
| 182 | 182 |
| 183 // Search for 'a'. | 183 // Search for 'a'. |
| 184 ui_test_utils::FindInPage(chrome::GetActiveTabContents(browser()), | 184 ui_test_utils::FindInPage(chrome::GetActiveTabContents(browser()), |
| 185 ASCIIToUTF16("a"), true, false, NULL); | 185 ASCIIToUTF16("a"), true, false, NULL); |
| 186 EXPECT_TRUE(ASCIIToUTF16("a") == find_bar->GetFindSelectedText()); | 186 EXPECT_TRUE(ASCIIToUTF16("a") == find_bar->GetFindSelectedText()); |
| 187 | 187 |
| 188 // Open another tab (tab B). | 188 // Open another tab (tab B). |
| 189 ui_test_utils::WindowedNotificationObserver observer( | 189 content::WindowedNotificationObserver observer( |
| 190 content::NOTIFICATION_LOAD_STOP, | 190 content::NOTIFICATION_LOAD_STOP, |
| 191 content::NotificationService::AllSources()); | 191 content::NotificationService::AllSources()); |
| 192 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); | 192 chrome::AddSelectedTabWithURL(browser(), url, content::PAGE_TRANSITION_TYPED); |
| 193 observer.Wait(); | 193 observer.Wait(); |
| 194 | 194 |
| 195 // Make sure Find box is open. | 195 // Make sure Find box is open. |
| 196 chrome::Find(browser()); | 196 chrome::Find(browser()); |
| 197 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), | 197 EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), |
| 198 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); | 198 VIEW_ID_FIND_IN_PAGE_TEXT_FIELD)); |
| 199 | 199 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); | 367 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); |
| 368 | 368 |
| 369 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 369 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 370 browser(), ui::VKEY_V, true, false, false, false)); | 370 browser(), ui::VKEY_V, true, false, false, false)); |
| 371 | 371 |
| 372 ASSERT_NO_FATAL_FAILURE(observer.Wait()); | 372 ASSERT_NO_FATAL_FAILURE(observer.Wait()); |
| 373 FindNotificationDetails details; | 373 FindNotificationDetails details; |
| 374 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); | 374 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); |
| 375 EXPECT_TRUE(details.number_of_matches() > 0); | 375 EXPECT_TRUE(details.number_of_matches() > 0); |
| 376 } | 376 } |
| OLD | NEW |