| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 ASSERT_TRUE(https_server.Start()); | 424 ASSERT_TRUE(https_server.Start()); |
| 425 | 425 |
| 426 // 1. Load an embedder page with one guest in it. | 426 // 1. Load an embedder page with one guest in it. |
| 427 const char kEmbedderURL[] = "/browser_plugin_embedder.html"; | 427 const char kEmbedderURL[] = "/browser_plugin_embedder.html"; |
| 428 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); | 428 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); |
| 429 | 429 |
| 430 // 2. Navigate to a URL in https, so we trigger a RenderViewHost swap. | 430 // 2. Navigate to a URL in https, so we trigger a RenderViewHost swap. |
| 431 GURL test_https_url(https_server.GetURL( | 431 GURL test_https_url(https_server.GetURL( |
| 432 "files/browser_plugin_title_change.html")); | 432 "files/browser_plugin_title_change.html")); |
| 433 content::WindowedNotificationObserver swap_observer( | 433 content::WindowedNotificationObserver swap_observer( |
| 434 content::NOTIFICATION_WEB_CONTENTS_SWAPPED, | 434 content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, |
| 435 content::Source<WebContents>(test_embedder()->web_contents())); | 435 content::Source<WebContents>(test_embedder()->web_contents())); |
| 436 NavigateToURL(shell(), test_https_url); | 436 NavigateToURL(shell(), test_https_url); |
| 437 swap_observer.Wait(); | 437 swap_observer.Wait(); |
| 438 | 438 |
| 439 TestBrowserPluginEmbedder* test_embedder_after_swap = | 439 TestBrowserPluginEmbedder* test_embedder_after_swap = |
| 440 static_cast<TestBrowserPluginEmbedder*>( | 440 static_cast<TestBrowserPluginEmbedder*>( |
| 441 static_cast<WebContentsImpl*>(shell()->web_contents())-> | 441 static_cast<WebContentsImpl*>(shell()->web_contents())-> |
| 442 GetBrowserPluginEmbedder()); | 442 GetBrowserPluginEmbedder()); |
| 443 // Verify we have a no embedder in web_contents (since the new page doesn't | 443 // Verify we have a no embedder in web_contents (since the new page doesn't |
| 444 // have any browser plugin). | 444 // have any browser plugin). |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 // should be blocked because the scheme isn't web-safe or a pseudo-scheme. | 813 // should be blocked because the scheme isn't web-safe or a pseudo-scheme. |
| 814 ExecuteSyncJSFunction( | 814 ExecuteSyncJSFunction( |
| 815 test_embedder()->web_contents()->GetRenderViewHost(), | 815 test_embedder()->web_contents()->GetRenderViewHost(), |
| 816 base::StringPrintf("SetSrc('%s://abc123');", | 816 base::StringPrintf("SetSrc('%s://abc123');", |
| 817 chrome::kGuestScheme)); | 817 chrome::kGuestScheme)); |
| 818 EXPECT_TRUE(delegate->load_aborted()); | 818 EXPECT_TRUE(delegate->load_aborted()); |
| 819 EXPECT_TRUE(delegate->load_aborted_url().is_valid()); | 819 EXPECT_TRUE(delegate->load_aborted_url().is_valid()); |
| 820 } | 820 } |
| 821 | 821 |
| 822 } // namespace content | 822 } // namespace content |
| OLD | NEW |