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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
826 rvh->DragTargetDragEnter(drop_data, gfx::Point(start_x, start_y), | 826 rvh->DragTargetDragEnter(drop_data, gfx::Point(start_x, start_y), |
827 gfx::Point(start_x, start_y), WebKit::WebDragOperationEvery, 0); | 827 gfx::Point(start_x, start_y), WebKit::WebDragOperationEvery, 0); |
828 rvh->DragTargetDragOver(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), | 828 rvh->DragTargetDragOver(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), |
829 WebKit::WebDragOperationEvery, 0); | 829 WebKit::WebDragOperationEvery, 0); |
830 rvh->DragTargetDrop(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), 0); | 830 rvh->DragTargetDrop(gfx::Point(end_x, end_y), gfx::Point(end_x, end_y), 0); |
831 | 831 |
832 string16 actual_title = title_watcher.WaitAndGetTitle(); | 832 string16 actual_title = title_watcher.WaitAndGetTitle(); |
833 EXPECT_EQ(expected_title, actual_title); | 833 EXPECT_EQ(expected_title, actual_title); |
834 } | 834 } |
835 | 835 |
836 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) { | |
837 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; | |
838 StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); | |
839 | |
840 const string16 expected_title = ASCIIToUTF16("loadStop"); | |
841 content::TitleWatcher title_watcher( | |
842 test_embedder()->web_contents(), expected_title); | |
843 // Renavigate the guest to |kHTMLForGuest|. | |
844 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | |
845 test_embedder()->web_contents()->GetRenderViewHost()); | |
846 ExecuteSyncJSFunction(rvh, ASCIIToUTF16( | |
847 StringPrintf("SetSrc('%s');", kHTMLForGuest))); | |
848 | |
849 string16 actual_title = title_watcher.WaitAndGetTitle(); | |
850 EXPECT_EQ(expected_title, actual_title); | |
851 } | |
852 | |
853 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) { | |
854 const char* kEmbedderURL = "files/browser_plugin_embedder.html"; | |
855 StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); | |
856 | |
857 //const string16 expected_prefix = ASCIIToUTF16("loadCommit:"); | |
858 const string16 expected_title = ASCIIToUTF16( | |
859 StringPrintf("loadCommit:%s", kHTMLForGuest)); | |
860 content::TitleWatcher title_watcher( | |
861 test_embedder()->web_contents(), expected_title); | |
862 // Renavigate the guest to |kHTMLForGuest|. | |
863 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | |
864 test_embedder()->web_contents()->GetRenderViewHost()); | |
865 ExecuteSyncJSFunction(rvh, ASCIIToUTF16( | |
866 StringPrintf("SetSrc('%s');", kHTMLForGuest))); | |
867 | |
868 string16 actual_title = title_watcher.WaitAndGetTitle(); | |
869 EXPECT_EQ(expected_title, actual_title); | |
870 scoped_ptr<base::Value> isTopLevel(rvh->ExecuteJavascriptAndGetValue( | |
Charlie Reis
2012/10/16 21:17:55
nit: is_top_level
irobert
2012/10/17 20:12:37
Done.
| |
871 string16(), ASCIIToUTF16("commitIsTopLevel"))); | |
872 bool t; | |
Charlie Reis
2012/10/16 21:17:55
bool top_level_bool = false;
irobert
2012/10/17 20:12:37
Done.
| |
873 EXPECT_TRUE(isTopLevel->GetAsBoolean(&t)); | |
874 EXPECT_EQ(true, t); | |
875 } | |
876 | |
836 } // namespace content | 877 } // namespace content |
OLD | NEW |