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 "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "chrome/test/base/bookmark_load_observer.h" | 48 #include "chrome/test/base/bookmark_load_observer.h" |
49 #include "content/public/browser/dom_operation_notification_details.h" | 49 #include "content/public/browser/dom_operation_notification_details.h" |
50 #include "content/public/browser/download_item.h" | 50 #include "content/public/browser/download_item.h" |
51 #include "content/public/browser/download_manager.h" | 51 #include "content/public/browser/download_manager.h" |
52 #include "content/public/browser/geolocation.h" | 52 #include "content/public/browser/geolocation.h" |
53 #include "content/public/browser/navigation_controller.h" | 53 #include "content/public/browser/navigation_controller.h" |
54 #include "content/public/browser/navigation_entry.h" | 54 #include "content/public/browser/navigation_entry.h" |
55 #include "content/public/browser/notification_service.h" | 55 #include "content/public/browser/notification_service.h" |
56 #include "content/public/browser/render_process_host.h" | 56 #include "content/public/browser/render_process_host.h" |
57 #include "content/public/browser/render_view_host.h" | 57 #include "content/public/browser/render_view_host.h" |
58 #include "content/public/browser/render_view_host_delegate.h" | |
59 #include "content/public/browser/web_contents.h" | 58 #include "content/public/browser/web_contents.h" |
60 #include "content/public/browser/web_contents_observer.h" | 59 #include "content/public/browser/web_contents_observer.h" |
61 #include "content/public/browser/web_contents_view.h" | 60 #include "content/public/browser/web_contents_view.h" |
62 #include "content/public/common/geoposition.h" | 61 #include "content/public/common/geoposition.h" |
63 #include "content/test/test_navigation_observer.h" | 62 #include "content/test/test_navigation_observer.h" |
64 #include "googleurl/src/gurl.h" | 63 #include "googleurl/src/gurl.h" |
65 #include "net/base/net_util.h" | 64 #include "net/base/net_util.h" |
66 #include "net/test/python_utils.h" | 65 #include "net/test/python_utils.h" |
67 #include "testing/gtest/include/gtest/gtest.h" | 66 #include "testing/gtest/include/gtest/gtest.h" |
68 #include "third_party/skia/include/core/SkBitmap.h" | 67 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 24 matching lines...) Expand all Loading... |
93 | 92 |
94 namespace ui_test_utils { | 93 namespace ui_test_utils { |
95 | 94 |
96 namespace { | 95 namespace { |
97 | 96 |
98 class DOMOperationObserver : public content::NotificationObserver, | 97 class DOMOperationObserver : public content::NotificationObserver, |
99 public content::WebContentsObserver { | 98 public content::WebContentsObserver { |
100 public: | 99 public: |
101 explicit DOMOperationObserver(RenderViewHost* render_view_host) | 100 explicit DOMOperationObserver(RenderViewHost* render_view_host) |
102 : content::WebContentsObserver( | 101 : content::WebContentsObserver( |
103 render_view_host->GetDelegate()->GetAsWebContents()), | 102 WebContents::FromRenderViewHost(render_view_host)), |
104 did_respond_(false) { | 103 did_respond_(false) { |
105 registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE, | 104 registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE, |
106 content::Source<RenderViewHost>(render_view_host)); | 105 content::Source<RenderViewHost>(render_view_host)); |
107 ui_test_utils::RunMessageLoop(); | 106 ui_test_utils::RunMessageLoop(); |
108 } | 107 } |
109 | 108 |
110 virtual void Observe(int type, | 109 virtual void Observe(int type, |
111 const content::NotificationSource& source, | 110 const content::NotificationSource& source, |
112 const content::NotificationDetails& details) OVERRIDE { | 111 const content::NotificationDetails& details) OVERRIDE { |
113 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); | 112 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 int state, | 1263 int state, |
1265 const base::Closure& followup) { | 1264 const base::Closure& followup) { |
1266 if (!followup.is_null()) | 1265 if (!followup.is_null()) |
1267 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); | 1266 ui_controls::SendMouseEventsNotifyWhenDone(button, state, followup); |
1268 else | 1267 else |
1269 ui_controls::SendMouseEvents(button, state); | 1268 ui_controls::SendMouseEvents(button, state); |
1270 } | 1269 } |
1271 | 1270 |
1272 } // namespace internal | 1271 } // namespace internal |
1273 } // namespace ui_test_utils | 1272 } // namespace ui_test_utils |
OLD | NEW |