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" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 ExtensionTestMessageListener guest_connected_listener("connected", false); | 213 ExtensionTestMessageListener guest_connected_listener("connected", false); |
214 LoadAndLaunchPlatformApp(app_name.c_str()); | 214 LoadAndLaunchPlatformApp(app_name.c_str()); |
215 | 215 |
216 guest_observer.Wait(); | 216 guest_observer.Wait(); |
217 | 217 |
218 // 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 |
219 // channel with the app. | 219 // channel with the app. |
220 ASSERT_TRUE(guest_connected_listener.WaitUntilSatisfied()); | 220 ASSERT_TRUE(guest_connected_listener.WaitUntilSatisfied()); |
221 content::Source<content::NavigationController> source = | 221 content::Source<content::NavigationController> source = |
222 guest_observer.source(); | 222 guest_observer.source(); |
223 EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()->IsGuest()); | 223 EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()-> |
| 224 IsIsolatedGuest()); |
224 | 225 |
225 guest_web_contents_ = source->GetWebContents(); | 226 guest_web_contents_ = source->GetWebContents(); |
226 embedder_web_contents_ = | 227 embedder_web_contents_ = |
227 GuestViewBase::FromWebContents(guest_web_contents_)-> | 228 GuestViewBase::FromWebContents(guest_web_contents_)-> |
228 embedder_web_contents(); | 229 embedder_web_contents(); |
229 | 230 |
230 gfx::Rect offset = embedder_web_contents_->GetContainerBounds(); | 231 gfx::Rect offset = embedder_web_contents_->GetContainerBounds(); |
231 corner_ = gfx::Point(offset.x(), offset.y()); | 232 corner_ = gfx::Point(offset.x(), offset.y()); |
232 | 233 |
233 const testing::TestInfo* const test_info = | 234 const testing::TestInfo* const test_info = |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 | 854 |
854 // Now verify that the selection text propagates properly to RWHV. | 855 // Now verify that the selection text propagates properly to RWHV. |
855 content::RenderWidgetHostView* guest_rwhv = | 856 content::RenderWidgetHostView* guest_rwhv = |
856 guest_web_contents()->GetRenderWidgetHostView(); | 857 guest_web_contents()->GetRenderWidgetHostView(); |
857 ASSERT_TRUE(guest_rwhv); | 858 ASSERT_TRUE(guest_rwhv); |
858 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); | 859 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); |
859 ASSERT_TRUE(selected_text.size() >= 10u); | 860 ASSERT_TRUE(selected_text.size() >= 10u); |
860 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); | 861 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); |
861 } | 862 } |
862 #endif | 863 #endif |
OLD | NEW |