Commit 9565b0cd authored by munjal@chromium.org's avatar munjal@chromium.org

Add a method to WebContentsTester to set the loading state of the

underlying WebContents. This will aid in testing more scenarios
with WebContents.

Review URL: https://chromiumcodereview.appspot.com/10381140

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137241 0039d316-1c4b-4281-b951-d872f2087c98
parent 7a696c67
......@@ -115,6 +115,10 @@ void TestWebContents::NavigateAndCommit(const GURL& url) {
CommitPendingNavigation();
}
void TestWebContents::TestSetIsLoading(bool value) {
SetIsLoading(value, NULL);
}
void TestWebContents::CommitPendingNavigation() {
// If we are doing a cross-site navigation, this simulates the current RVH
// notifying that it has unloaded so the pending RVH is resumed and can
......
......@@ -31,6 +31,7 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester {
virtual int GetNumberOfFocusCalls() OVERRIDE;
virtual RenderViewHost* GetPendingRenderViewHost() const OVERRIDE;
virtual void NavigateAndCommit(const GURL& url) OVERRIDE;
virtual void TestSetIsLoading(bool value) OVERRIDE;
virtual void ProceedWithCrossSiteNavigation() OVERRIDE;
virtual void TestDidNavigate(RenderViewHost* render_view_host,
int page_id,
......
......@@ -94,6 +94,9 @@ class WebContentsTester {
// emulates what happens on a new navigation.
virtual void NavigateAndCommit(const GURL& url) = 0;
// Sets the loading state to the given value.
virtual void TestSetIsLoading(bool value) = 0;
// Simulates the current RVH notifying that it has unloaded so that the
// pending RVH navigation can proceed.
// Does nothing if no cross-navigation is pending.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment