| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 browser_plugin->GuestCrashed(); | 285 browser_plugin->GuestCrashed(); |
| 286 | 286 |
| 287 // Verify that our event listener has fired. | 287 // Verify that our event listener has fired. |
| 288 EXPECT_EQ("crashed", ExecuteScriptAndReturnString("msg")); | 288 EXPECT_EQ("crashed", ExecuteScriptAndReturnString("msg")); |
| 289 | 289 |
| 290 // Send an event and verify that events are no longer deported. | 290 // Send an event and verify that events are no longer deported. |
| 291 browser_plugin->handleInputEvent(WebKit::WebMouseEvent(), | 291 browser_plugin->handleInputEvent(WebKit::WebMouseEvent(), |
| 292 cursor_info); | 292 cursor_info); |
| 293 EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching( | 293 EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching( |
| 294 BrowserPluginHostMsg_HandleInputEvent::ID)); | 294 BrowserPluginHostMsg_HandleInputEvent::ID)); |
| 295 | |
| 296 // Navigate and verify that the guest_crashed_ flag has been reset. | |
| 297 browser_plugin->SetSrcAttribute("bar"); | |
| 298 EXPECT_FALSE(browser_plugin->guest_crashed_); | |
| 299 } | 295 } |
| 300 | 296 |
| 301 TEST_F(BrowserPluginTest, RemovePlugin) { | 297 TEST_F(BrowserPluginTest, RemovePlugin) { |
| 302 LoadHTML(GetHTMLForBrowserPluginObject().c_str()); | 298 LoadHTML(GetHTMLForBrowserPluginObject().c_str()); |
| 303 EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching( | 299 EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching( |
| 304 BrowserPluginHostMsg_PluginDestroyed::ID)); | 300 BrowserPluginHostMsg_PluginDestroyed::ID)); |
| 305 ExecuteJavaScript("x = document.getElementById('browserplugin'); " | 301 ExecuteJavaScript("x = document.getElementById('browserplugin'); " |
| 306 "x.parentNode.removeChild(x);"); | 302 "x.parentNode.removeChild(x);"); |
| 307 ProcessPendingMessages(); | 303 ProcessPendingMessages(); |
| 308 EXPECT_TRUE(browser_plugin_manager()->sink().GetUniqueMessageMatching( | 304 EXPECT_TRUE(browser_plugin_manager()->sink().GetUniqueMessageMatching( |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 EXPECT_STREQ( | 486 EXPECT_STREQ( |
| 491 "The object has already navigated, so its partition cannot be changed.", | 487 "The object has already navigated, so its partition cannot be changed.", |
| 492 title.c_str()); | 488 title.c_str()); |
| 493 | 489 |
| 494 partition_value = ExecuteScriptAndReturnString( | 490 partition_value = ExecuteScriptAndReturnString( |
| 495 "document.getElementById('browserplugin').partition"); | 491 "document.getElementById('browserplugin').partition"); |
| 496 EXPECT_STREQ("storage", partition_value.c_str()); | 492 EXPECT_STREQ("storage", partition_value.c_str()); |
| 497 } | 493 } |
| 498 | 494 |
| 499 } // namespace content | 495 } // namespace content |
| OLD | NEW |