OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); | 449 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); |
450 WebContentsImpl* embedder_web_contents = test_embedder()->web_contents(); | 450 WebContentsImpl* embedder_web_contents = test_embedder()->web_contents(); |
451 | 451 |
452 // Navigate to another page in same host and port, so RenderViewHost swap | 452 // Navigate to another page in same host and port, so RenderViewHost swap |
453 // does not happen and existing embedder doesn't change in web_contents. | 453 // does not happen and existing embedder doesn't change in web_contents. |
454 GURL test_url_new(embedded_test_server()->GetURL( | 454 GURL test_url_new(embedded_test_server()->GetURL( |
455 "/browser_plugin_title_change.html")); | 455 "/browser_plugin_title_change.html")); |
456 const string16 expected_title = ASCIIToUTF16("done"); | 456 const string16 expected_title = ASCIIToUTF16("done"); |
457 content::TitleWatcher title_watcher(shell()->web_contents(), expected_title); | 457 content::TitleWatcher title_watcher(shell()->web_contents(), expected_title); |
458 NavigateToURL(shell(), test_url_new); | 458 NavigateToURL(shell(), test_url_new); |
459 LOG(INFO) << "Start waiting for title"; | 459 VLOG(0) << "Start waiting for title"; |
460 string16 actual_title = title_watcher.WaitAndGetTitle(); | 460 string16 actual_title = title_watcher.WaitAndGetTitle(); |
461 EXPECT_EQ(expected_title, actual_title); | 461 EXPECT_EQ(expected_title, actual_title); |
462 LOG(INFO) << "Done navigating to second page"; | 462 VLOG(0) << "Done navigating to second page"; |
463 | 463 |
464 TestBrowserPluginEmbedder* test_embedder_after_nav = | 464 TestBrowserPluginEmbedder* test_embedder_after_nav = |
465 static_cast<TestBrowserPluginEmbedder*>( | 465 static_cast<TestBrowserPluginEmbedder*>( |
466 embedder_web_contents->GetBrowserPluginEmbedder()); | 466 embedder_web_contents->GetBrowserPluginEmbedder()); |
467 // Embedder must not change in web_contents. | 467 // Embedder must not change in web_contents. |
468 ASSERT_EQ(test_embedder_after_nav, test_embedder()); | 468 ASSERT_EQ(test_embedder_after_nav, test_embedder()); |
469 } | 469 } |
470 | 470 |
471 // This test verifies that hiding the embedder also hides the guest. | 471 // This test verifies that hiding the embedder also hides the guest. |
472 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) { | 472 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) { |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 // Attempt a navigation to chrome-guest://abc123, which is a valid URL. But it | 804 // Attempt a navigation to chrome-guest://abc123, which is a valid URL. But it |
805 // should be blocked because the scheme isn't web-safe or a pseudo-scheme. | 805 // should be blocked because the scheme isn't web-safe or a pseudo-scheme. |
806 ExecuteSyncJSFunction( | 806 ExecuteSyncJSFunction( |
807 test_embedder()->web_contents()->GetRenderViewHost(), | 807 test_embedder()->web_contents()->GetRenderViewHost(), |
808 base::StringPrintf("SetSrc('%s://abc123');", kGuestScheme)); | 808 base::StringPrintf("SetSrc('%s://abc123');", kGuestScheme)); |
809 EXPECT_TRUE(delegate->load_aborted()); | 809 EXPECT_TRUE(delegate->load_aborted()); |
810 EXPECT_TRUE(delegate->load_aborted_url().is_valid()); | 810 EXPECT_TRUE(delegate->load_aborted_url().is_valid()); |
811 } | 811 } |
812 | 812 |
813 } // namespace content | 813 } // namespace content |
OLD | NEW |