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 "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/apps/app_browsertest_util.h" | 8 #include "chrome/browser/apps/app_browsertest_util.h" |
9 #include "chrome/browser/chrome_content_browser_client.h" | 9 #include "chrome/browser/chrome_content_browser_client.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 guest_web_contents_ = GetGuestViewManager()->WaitForGuestAdded(); | 287 guest_web_contents_ = GetGuestViewManager()->WaitForGuestAdded(); |
288 } | 288 } |
289 | 289 |
290 void RunTest(const std::string& app_name) { | 290 void RunTest(const std::string& app_name) { |
291 } | 291 } |
292 void SetupTest(const std::string& app_name, | 292 void SetupTest(const std::string& app_name, |
293 const std::string& guest_url_spec) { | 293 const std::string& guest_url_spec) { |
294 ASSERT_TRUE(StartEmbeddedTestServer()); | 294 ASSERT_TRUE(StartEmbeddedTestServer()); |
295 GURL::Replacements replace_host; | 295 GURL::Replacements replace_host; |
296 std::string host_str("localhost"); // Must stay in scope with replace_host. | 296 replace_host.SetHostStr("localhost"); |
297 replace_host.SetHostStr(host_str); | |
298 | 297 |
299 GURL guest_url = embedded_test_server()->GetURL(guest_url_spec); | 298 GURL guest_url = embedded_test_server()->GetURL(guest_url_spec); |
300 guest_url = guest_url.ReplaceComponents(replace_host); | 299 guest_url = guest_url.ReplaceComponents(replace_host); |
301 | 300 |
302 ui_test_utils::UrlLoadObserver guest_observer( | 301 ui_test_utils::UrlLoadObserver guest_observer( |
303 guest_url, content::NotificationService::AllSources()); | 302 guest_url, content::NotificationService::AllSources()); |
304 | 303 |
305 LoadAndLaunchPlatformApp(app_name.c_str(), "connected"); | 304 LoadAndLaunchPlatformApp(app_name.c_str(), "connected"); |
306 | 305 |
307 guest_observer.Wait(); | 306 guest_observer.Wait(); |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 | 1166 |
1168 // Now verify that the selection text propagates properly to RWHV. | 1167 // Now verify that the selection text propagates properly to RWHV. |
1169 content::RenderWidgetHostView* guest_rwhv = | 1168 content::RenderWidgetHostView* guest_rwhv = |
1170 guest_web_contents()->GetRenderWidgetHostView(); | 1169 guest_web_contents()->GetRenderWidgetHostView(); |
1171 ASSERT_TRUE(guest_rwhv); | 1170 ASSERT_TRUE(guest_rwhv); |
1172 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); | 1171 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); |
1173 ASSERT_TRUE(selected_text.size() >= 10u); | 1172 ASSERT_TRUE(selected_text.size() >= 10u); |
1174 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); | 1173 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); |
1175 } | 1174 } |
1176 #endif | 1175 #endif |
OLD | NEW |