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/memory/singleton.h" | 5 #include "base/memory/singleton.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 std::string result; | 683 std::string result; |
684 EXPECT_TRUE(v->GetAsString(&result)); | 684 EXPECT_TRUE(v->GetAsString(&result)); |
685 EXPECT_EQ(redirect_url.spec().c_str(), result); | 685 EXPECT_EQ(redirect_url.spec().c_str(), result); |
686 | 686 |
687 v = rvh->ExecuteJavascriptAndGetValue( | 687 v = rvh->ExecuteJavascriptAndGetValue( |
688 string16(), ASCIIToUTF16("redirectNewUrl")); | 688 string16(), ASCIIToUTF16("redirectNewUrl")); |
689 EXPECT_TRUE(v->GetAsString(&result)); | 689 EXPECT_TRUE(v->GetAsString(&result)); |
690 EXPECT_EQ(test_server()->GetURL("files/title1.html").spec().c_str(), result); | 690 EXPECT_EQ(test_server()->GetURL("files/title1.html").spec().c_str(), result); |
691 } | 691 } |
692 | 692 |
| 693 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TitleChanged) { |
| 694 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; |
| 695 StartBrowserPluginTest(kEmbedderURL, "about:blank", true, |
| 696 "shouldEchoTitle=true"); |
| 697 |
| 698 const string16 expected_title = ASCIIToUTF16("Title Of Awesomeness"); |
| 699 content::TitleWatcher title_watcher(test_embedder()->web_contents(), |
| 700 expected_title); |
| 701 |
| 702 // Navigate and wait until the title changes. |
| 703 GURL redirect_url(test_server()->GetURL("files/title2.html")); |
| 704 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
| 705 test_embedder()->web_contents()->GetRenderViewHost()); |
| 706 rvh->ExecuteJavascriptAndGetValue(string16(), ASCIIToUTF16( |
| 707 StringPrintf("SetSrc('%s');", redirect_url.spec().c_str()))); |
| 708 |
| 709 string16 actual_title = title_watcher.WaitAndGetTitle(); |
| 710 EXPECT_EQ(expected_title, actual_title); |
| 711 } |
| 712 |
693 } // namespace content | 713 } // namespace content |
OLD | NEW |