OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/app_window.h" | 5 #include "apps/app_window.h" |
6 #include "apps/app_window_registry.h" | 6 #include "apps/app_window_registry.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/apps/app_browsertest_util.h" | 10 #include "chrome/browser/apps/app_browsertest_util.h" |
11 #include "chrome/browser/extensions/extension_test_message_listener.h" | 11 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 12 #include "chrome/browser/guest_view/guest_view_base.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/renderer_context_menu/render_view_context_menu_browsert
est_util.h" | 14 #include "chrome/browser/renderer_context_menu/render_view_context_menu_browsert
est_util.h" |
14 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 15 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
15 #include "chrome/test/base/interactive_test_utils.h" | 16 #include "chrome/test/base/interactive_test_utils.h" |
16 #include "chrome/test/base/test_launcher_utils.h" | 17 #include "chrome/test/base/test_launcher_utils.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
19 #include "content/public/browser/render_process_host.h" | 20 #include "content/public/browser/render_process_host.h" |
20 #include "content/public/browser/render_view_host.h" | 21 #include "content/public/browser/render_view_host.h" |
21 #include "content/public/browser/render_widget_host_view.h" | 22 #include "content/public/browser/render_widget_host_view.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 guest_observer.Wait(); | 216 guest_observer.Wait(); |
216 | 217 |
217 // Wait until the guest process reports that it has established a message | 218 // Wait until the guest process reports that it has established a message |
218 // channel with the app. | 219 // channel with the app. |
219 ASSERT_TRUE(guest_connected_listener.WaitUntilSatisfied()); | 220 ASSERT_TRUE(guest_connected_listener.WaitUntilSatisfied()); |
220 content::Source<content::NavigationController> source = | 221 content::Source<content::NavigationController> source = |
221 guest_observer.source(); | 222 guest_observer.source(); |
222 EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()->IsGuest()); | 223 EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()->IsGuest()); |
223 | 224 |
224 guest_web_contents_ = source->GetWebContents(); | 225 guest_web_contents_ = source->GetWebContents(); |
225 embedder_web_contents_ = guest_web_contents_->GetEmbedderWebContents(); | 226 embedder_web_contents_ = |
| 227 GuestViewBase::FromWebContents(guest_web_contents_)-> |
| 228 embedder_web_contents(); |
226 | 229 |
227 gfx::Rect offset = embedder_web_contents_->GetContainerBounds(); | 230 gfx::Rect offset = embedder_web_contents_->GetContainerBounds(); |
228 corner_ = gfx::Point(offset.x(), offset.y()); | 231 corner_ = gfx::Point(offset.x(), offset.y()); |
229 | 232 |
230 const testing::TestInfo* const test_info = | 233 const testing::TestInfo* const test_info = |
231 testing::UnitTest::GetInstance()->current_test_info(); | 234 testing::UnitTest::GetInstance()->current_test_info(); |
232 const char* prefix = "DragDropWithinWebView"; | 235 const char* prefix = "DragDropWithinWebView"; |
233 if (!strncmp(test_info->name(), prefix, strlen(prefix))) { | 236 if (!strncmp(test_info->name(), prefix, strlen(prefix))) { |
234 // In the drag drop test we add 20px padding to the page body because on | 237 // In the drag drop test we add 20px padding to the page body because on |
235 // windows if we get too close to the edge of the window the resize cursor | 238 // windows if we get too close to the edge of the window the resize cursor |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 | 787 |
785 // Now verify that the selection text propagates properly to RWHV. | 788 // Now verify that the selection text propagates properly to RWHV. |
786 content::RenderWidgetHostView* guest_rwhv = | 789 content::RenderWidgetHostView* guest_rwhv = |
787 guest_web_contents()->GetRenderWidgetHostView(); | 790 guest_web_contents()->GetRenderWidgetHostView(); |
788 ASSERT_TRUE(guest_rwhv); | 791 ASSERT_TRUE(guest_rwhv); |
789 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); | 792 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); |
790 ASSERT_TRUE(selected_text.size() >= 10u); | 793 ASSERT_TRUE(selected_text.size() >= 10u); |
791 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); | 794 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); |
792 } | 795 } |
793 #endif | 796 #endif |
OLD | NEW |