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 "content/renderer/browser_plugin/browser_plugin_browsertest.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_browsertest.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "content/common/browser_plugin_messages.h" | 10 #include "content/common/browser_plugin_messages.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 browser_plugin->DidNavigate(GURL(kGoogleURL)); | 316 browser_plugin->DidNavigate(GURL(kGoogleURL)); |
317 EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url")); | 317 EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url")); |
318 | 318 |
319 ExecuteJavaScript(kRemoveEventListener); | 319 ExecuteJavaScript(kRemoveEventListener); |
320 browser_plugin->DidNavigate(GURL(kGoogleNewsURL)); | 320 browser_plugin->DidNavigate(GURL(kGoogleNewsURL)); |
321 // The URL variable should not change because we've removed the event | 321 // The URL variable should not change because we've removed the event |
322 // listener. | 322 // listener. |
323 EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url")); | 323 EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url")); |
324 } | 324 } |
325 | 325 |
| 326 TEST_F(BrowserPluginTest, StopMethod) { |
| 327 const char* kCallStop = |
| 328 "document.getElementById('browserplugin').stop();"; |
| 329 LoadHTML(GetHTMLForBrowserPluginObject().c_str()); |
| 330 ExecuteJavaScript(kCallStop); |
| 331 EXPECT_TRUE(browser_plugin_manager()->sink().GetUniqueMessageMatching( |
| 332 BrowserPluginHostMsg_Stop::ID)); |
| 333 } |
| 334 |
| 335 TEST_F(BrowserPluginTest, ReloadMethod) { |
| 336 const char* kCallReload = |
| 337 "document.getElementById('browserplugin').reload();"; |
| 338 LoadHTML(GetHTMLForBrowserPluginObject().c_str()); |
| 339 ExecuteJavaScript(kCallReload); |
| 340 EXPECT_TRUE(browser_plugin_manager()->sink().GetUniqueMessageMatching( |
| 341 BrowserPluginHostMsg_Reload::ID)); |
| 342 } |
| 343 |
326 } // namespace content | 344 } // namespace content |
OLD | NEW |