| 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 FindBarView* GetFindBarView() { return GetFindBarHost()->find_bar_view(); } | 49 FindBarView* GetFindBarView() { return GetFindBarHost()->find_bar_view(); } |
| 50 | 50 |
| 51 base::string16 GetFindBarText() { return GetFindBarHost()->GetFindText(); } | 51 base::string16 GetFindBarText() { return GetFindBarHost()->GetFindText(); } |
| 52 | 52 |
| 53 base::string16 GetFindBarSelectedText() { | 53 base::string16 GetFindBarSelectedText() { |
| 54 return GetFindBarHost()->GetFindBarTesting()->GetFindSelectedText(); | 54 return GetFindBarHost()->GetFindBarTesting()->GetFindSelectedText(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void ClickOnView(views::View* view) { | 57 void ClickOnView(views::View* view) { |
| 58 // EventGenerator and ui_test_utils can't target the find bar (on Windows). | 58 // EventGenerator and ui_test_utils can't target the find bar (on Windows). |
| 59 view->OnMousePressed(ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), | 59 view->OnMousePressed(ui::MouseEvent( |
| 60 gfx::Point(), base::TimeTicks(), | 60 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), base::TimeTicks(), |
| 61 ui::EF_LEFT_MOUSE_BUTTON, | 61 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 62 ui::EF_LEFT_MOUSE_BUTTON)); | 62 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE))); |
| 63 view->OnMouseReleased(ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), | 63 view->OnMouseReleased(ui::MouseEvent( |
| 64 gfx::Point(), base::TimeTicks(), | 64 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), base::TimeTicks(), |
| 65 ui::EF_LEFT_MOUSE_BUTTON, | 65 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 66 ui::EF_LEFT_MOUSE_BUTTON)); | 66 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE))); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void TapOnView(views::View* view) { | 69 void TapOnView(views::View* view) { |
| 70 // EventGenerator and ui_test_utils can't target the find bar (on Windows). | 70 // EventGenerator and ui_test_utils can't target the find bar (on Windows). |
| 71 ui::GestureEvent event(0, 0, 0, base::TimeTicks(), | 71 ui::GestureEvent event(0, 0, 0, base::TimeTicks(), |
| 72 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 72 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 73 view->OnGestureEvent(&event); | 73 view->OnGestureEvent(&event); |
| 74 } | 74 } |
| 75 | 75 |
| 76 FindNotificationDetails WaitForFindResult() { | 76 FindNotificationDetails WaitForFindResult() { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 531 |
| 532 ui_test_utils::UrlLoadObserver observer( | 532 ui_test_utils::UrlLoadObserver observer( |
| 533 GURL("about:blank"), content::NotificationService::AllSources()); | 533 GURL("about:blank"), content::NotificationService::AllSources()); |
| 534 | 534 |
| 535 // Send Ctrl-Enter, should cause navigation to about:blank. | 535 // Send Ctrl-Enter, should cause navigation to about:blank. |
| 536 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( | 536 ASSERT_TRUE(ui_test_utils::SendKeyPressSync( |
| 537 browser(), ui::VKEY_RETURN, true, false, false, false)); | 537 browser(), ui::VKEY_RETURN, true, false, false, false)); |
| 538 | 538 |
| 539 observer.Wait(); | 539 observer.Wait(); |
| 540 } | 540 } |
| OLD | NEW |