Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_browsertest.cc

Issue 10917225: Browser Plugin: Reload and Stop operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nit Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin_bindings.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698