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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 783 rvh->DragTargetDragEnter(drop_data, gfx::Point(start_x, start_y), | 783 rvh->DragTargetDragEnter(drop_data, gfx::Point(start_x, start_y), |
| 784 gfx::Point(start_x, start_y), WebKit::WebDragOperationEvery, 0); | 784 gfx::Point(start_x, start_y), WebKit::WebDragOperationEvery, 0); |
| 785 rvh->DragTargetDragOver(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), | 785 rvh->DragTargetDragOver(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), |
| 786 WebKit::WebDragOperationEvery, 0); | 786 WebKit::WebDragOperationEvery, 0); |
| 787 rvh->DragTargetDrop(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), 0); | 787 rvh->DragTargetDrop(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), 0); |
| 788 | 788 |
| 789 string16 actual_title = title_watcher.WaitAndGetTitle(); | 789 string16 actual_title = title_watcher.WaitAndGetTitle(); |
| 790 EXPECT_EQ(expected_title, actual_title); | 790 EXPECT_EQ(expected_title, actual_title); |
| 791 } | 791 } |
| 792 | 792 |
| 793 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) { | |
| 794 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; | |
| 795 StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); | |
| 796 | |
| 797 const string16 expected_title = ASCIIToUTF16("loadStop"); | |
| 798 content::TitleWatcher title_watcher( | |
| 799 test_embedder()->web_contents(), expected_title); | |
| 800 // Renavigate the guest to |kHTMLForGuest|. | |
| 801 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | |
| 802 test_embedder()->web_contents()->GetRenderViewHost()); | |
| 803 rvh->ExecuteJavascriptAndGetValue(string16(), ASCIIToUTF16( | |
|
Fady Samuel
2012/10/15 19:59:20
Please use ExecuteSyncJSFunction.
irobert
2012/10/16 01:26:39
Done.
| |
| 804 StringPrintf("SetSrc('%s');", kHTMLForGuest))); | |
| 805 | |
| 806 string16 actual_title = title_watcher.WaitAndGetTitle(); | |
| 807 EXPECT_EQ(expected_title, actual_title); | |
| 808 } | |
| 809 | |
| 810 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) { | |
| 811 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; | |
| 812 StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); | |
| 813 | |
| 814 //const string16 expected_prefix = ASCIIToUTF16("loadCommit:"); | |
| 815 const string16 expected_title = ASCIIToUTF16( | |
| 816 StringPrintf("loadCommit:%s", kHTMLForGuest)); | |
| 817 content::TitleWatcher title_watcher( | |
| 818 test_embedder()->web_contents(), expected_title); | |
| 819 // Renavigate the guest to |kHTMLForGuest|. | |
| 820 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | |
| 821 test_embedder()->web_contents()->GetRenderViewHost()); | |
| 822 rvh->ExecuteJavascriptAndGetValue(string16(), ASCIIToUTF16( | |
|
Fady Samuel
2012/10/15 19:59:20
Please use ExecuteSyncJSFunction.
irobert
2012/10/16 01:26:39
Done.
| |
| 823 StringPrintf("SetSrc('%s');", kHTMLForGuest))); | |
| 824 | |
| 825 string16 actual_title = title_watcher.WaitAndGetTitle(); | |
| 826 EXPECT_EQ(expected_title, actual_title); | |
| 827 base::Value* isTopLevel = rvh->ExecuteJavascriptAndGetValue( | |
| 828 string16(), ASCIIToUTF16("commitIsTopLevel")); | |
| 829 bool t; | |
| 830 EXPECT_TRUE(isTopLevel->GetAsBoolean(&t)); | |
| 831 EXPECT_EQ(true, t); | |
| 832 } | |
| 833 | |
| 793 } // namespace content | 834 } // namespace content |
| OLD | NEW |