OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/string_split.h" | 8 #include "base/string_split.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 test_guest()->WaitForAdvanceFocus(); | 460 test_guest()->WaitForAdvanceFocus(); |
461 } | 461 } |
462 | 462 |
463 // This test opens a page in http and then opens another page in https, forcing | 463 // This test opens a page in http and then opens another page in https, forcing |
464 // a RenderViewHost swap in the web_contents. We verify that the embedder in the | 464 // a RenderViewHost swap in the web_contents. We verify that the embedder in the |
465 // web_contents gets cleared properly. | 465 // web_contents gets cleared properly. |
466 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) { | 466 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) { |
467 net::TestServer https_server( | 467 net::TestServer https_server( |
468 net::TestServer::TYPE_HTTPS, | 468 net::TestServer::TYPE_HTTPS, |
469 net::TestServer::kLocalhost, | 469 net::TestServer::kLocalhost, |
470 base::FilePath(FILE_PATH_LITERAL("content/test/data"))); | 470 net::TestServer::GetSourceRelativePath( |
| 471 base::FilePath(FILE_PATH_LITERAL("content/test/data")))); |
471 ASSERT_TRUE(https_server.Start()); | 472 ASSERT_TRUE(https_server.Start()); |
472 | 473 |
473 // 1. Load an embedder page with one guest in it. | 474 // 1. Load an embedder page with one guest in it. |
474 const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; | 475 const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; |
475 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); | 476 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); |
476 | 477 |
477 // 2. Navigate to a URL in https, so we trigger a RenderViewHost swap. | 478 // 2. Navigate to a URL in https, so we trigger a RenderViewHost swap. |
478 GURL test_https_url(https_server.GetURL( | 479 GURL test_https_url(https_server.GetURL( |
479 "files/browser_plugin_title_change.html")); | 480 "files/browser_plugin_title_change.html")); |
480 content::WindowedNotificationObserver swap_observer( | 481 content::WindowedNotificationObserver swap_observer( |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 const string16 expected_title = ASCIIToUTF16("AutoSize(640, 480)"); | 1365 const string16 expected_title = ASCIIToUTF16("AutoSize(640, 480)"); |
1365 content::TitleWatcher title_watcher(test_embedder()->web_contents(), | 1366 content::TitleWatcher title_watcher(test_embedder()->web_contents(), |
1366 expected_title); | 1367 expected_title); |
1367 RemoveAttributes(rvh, "maxwidth"); | 1368 RemoveAttributes(rvh, "maxwidth"); |
1368 string16 actual_title = title_watcher.WaitAndGetTitle(); | 1369 string16 actual_title = title_watcher.WaitAndGetTitle(); |
1369 EXPECT_EQ(expected_title, actual_title); | 1370 EXPECT_EQ(expected_title, actual_title); |
1370 } | 1371 } |
1371 } | 1372 } |
1372 | 1373 |
1373 } // namespace content | 1374 } // namespace content |
OLD | NEW |