| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 11 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 11 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 12 #include "chrome/browser/ui/view_ids.h" | 12 #include "chrome/browser/ui/view_ids.h" |
| 13 #include "chrome/browser/ui/views/find_bar_host.h" | 13 #include "chrome/browser/ui/views/find_bar_host.h" |
| 14 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 15 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/test/in_process_browser_test.h" | 16 #include "chrome/test/in_process_browser_test.h" |
| 16 #include "chrome/test/ui_test_utils.h" | 17 #include "chrome/test/ui_test_utils.h" |
| 17 #include "content/browser/tab_contents/tab_contents.h" | 18 #include "content/browser/tab_contents/tab_contents.h" |
| 18 #include "net/test/test_server.h" | 19 #include "net/test/test_server.h" |
| 19 #include "ui/base/clipboard/clipboard.h" | 20 #include "ui/base/clipboard/clipboard.h" |
| 20 #include "ui/base/keycodes/keyboard_codes.h" | 21 #include "ui/base/keycodes/keyboard_codes.h" |
| 21 #include "views/focus/focus_manager.h" | 22 #include "views/focus/focus_manager.h" |
| 22 #include "views/view.h" | 23 #include "views/view.h" |
| 23 #include "views/views_delegate.h" | 24 #include "views/views_delegate.h" |
| 24 | 25 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 ReadText(ui::Clipboard::BUFFER_STANDARD, &str); | 319 ReadText(ui::Clipboard::BUFFER_STANDARD, &str); |
| 319 | 320 |
| 320 // Make sure the text is copied successfully. | 321 // Make sure the text is copied successfully. |
| 321 EXPECT_EQ(ASCIIToUTF16("a"), str); | 322 EXPECT_EQ(ASCIIToUTF16("a"), str); |
| 322 | 323 |
| 323 // Press Ctrl-V to paste the content back, it should start finding even if the | 324 // Press Ctrl-V to paste the content back, it should start finding even if the |
| 324 // content is not changed. | 325 // content is not changed. |
| 325 Source<TabContents> notification_source(browser()->GetSelectedTabContents()); | 326 Source<TabContents> notification_source(browser()->GetSelectedTabContents()); |
| 326 ui_test_utils::WindowedNotificationObserverWithDetails | 327 ui_test_utils::WindowedNotificationObserverWithDetails |
| 327 <FindNotificationDetails> observer( | 328 <FindNotificationDetails> observer( |
| 328 NotificationType::FIND_RESULT_AVAILABLE, notification_source); | 329 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, notification_source); |
| 329 | 330 |
| 330 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 331 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 331 browser(), ui::VKEY_V, true, false, false, false)); | 332 browser(), ui::VKEY_V, true, false, false, false)); |
| 332 | 333 |
| 333 ASSERT_NO_FATAL_FAILURE(observer.Wait()); | 334 ASSERT_NO_FATAL_FAILURE(observer.Wait()); |
| 334 FindNotificationDetails details; | 335 FindNotificationDetails details; |
| 335 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); | 336 ASSERT_TRUE(observer.GetDetailsFor(notification_source.map_key(), &details)); |
| 336 EXPECT_TRUE(details.number_of_matches() > 0); | 337 EXPECT_TRUE(details.number_of_matches() > 0); |
| 337 } | 338 } |
| OLD | NEW |