Chromium Code Reviews| 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/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 10 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 705 content::TitleWatcher title_watcher(test_embedder()->web_contents(), | 705 content::TitleWatcher title_watcher(test_embedder()->web_contents(), |
| 706 expected_title); | 706 expected_title); |
| 707 | 707 |
| 708 test_embedder()->web_contents()->GetController().Reload(false); | 708 test_embedder()->web_contents()->GetController().Reload(false); |
| 709 string16 actual_title = title_watcher.WaitAndGetTitle(); | 709 string16 actual_title = title_watcher.WaitAndGetTitle(); |
| 710 EXPECT_EQ(expected_title, actual_title); | 710 EXPECT_EQ(expected_title, actual_title); |
| 711 | 711 |
| 712 ExecuteSyncJSFunction( | 712 ExecuteSyncJSFunction( |
| 713 test_embedder()->web_contents()->GetRenderViewHost(), | 713 test_embedder()->web_contents()->GetRenderViewHost(), |
| 714 StringPrintf("SetSrc('%s');", kHTMLForGuest)); | 714 StringPrintf("SetSrc('%s');", kHTMLForGuest)); |
| 715 test_embedder()->WaitForGuestAdded(); | |
| 715 | 716 |
| 716 const BrowserPluginEmbedder::ContainerInstanceMap& instance_map = | 717 const BrowserPluginEmbedder::ContainerInstanceMap& instance_map = |
| 717 test_embedder()->guest_web_contents_for_testing(); | 718 test_embedder()->guest_web_contents_for_testing(); |
| 718 WebContentsImpl* test_guest_web_contents = static_cast<WebContentsImpl*>( | 719 WebContentsImpl* test_guest_web_contents = static_cast<WebContentsImpl*>( |
| 719 instance_map.begin()->second); | 720 instance_map.begin()->second); |
| 720 TestBrowserPluginGuest* new_test_guest = | 721 TestBrowserPluginGuest* new_test_guest = |
| 721 static_cast<TestBrowserPluginGuest*>( | 722 static_cast<TestBrowserPluginGuest*>( |
| 722 test_guest_web_contents->GetBrowserPluginGuest()); | 723 test_guest_web_contents->GetBrowserPluginGuest()); |
| 724 ASSERT_NE(new_test_guest, static_cast<void*>(NULL)); | |
|
lazyboy
2013/01/17 17:39:25
nit: maybe ASSERT_TRUE(new_tests_guest != NULL); i
Fady Samuel
2013/01/17 18:40:38
Done.
| |
| 723 | 725 |
| 724 // Wait for the guest to send an UpdateRectMsg, meaning it is ready. | 726 // Wait for the guest to send an UpdateRectMsg, meaning it is ready. |
| 725 new_test_guest->WaitForUpdateRectMsg(); | 727 new_test_guest->WaitForUpdateRectMsg(); |
| 726 } | 728 } |
| 727 } | 729 } |
| 728 | 730 |
| 729 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) { | 731 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) { |
| 730 const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; | 732 const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; |
| 731 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); | 733 StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); |
| 732 | 734 |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1281 expected_title); | 1283 expected_title); |
| 1282 ExecuteSyncJSFunction(rvh, | 1284 ExecuteSyncJSFunction(rvh, |
| 1283 "document.getElementById('plugin').name = 'foobar';"); | 1285 "document.getElementById('plugin').name = 'foobar';"); |
| 1284 string16 actual_title = title_watcher.WaitAndGetTitle(); | 1286 string16 actual_title = title_watcher.WaitAndGetTitle(); |
| 1285 EXPECT_EQ(expected_title, actual_title); | 1287 EXPECT_EQ(expected_title, actual_title); |
| 1286 | 1288 |
| 1287 } | 1289 } |
| 1288 } | 1290 } |
| 1289 | 1291 |
| 1290 } // namespace content | 1292 } // namespace content |
| OLD | NEW |