diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-21 08:40:34 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-21 08:40:34 +0000 |
commit | b283d295de80df36c95121468beeba0f9c23b504 (patch) | |
tree | 7e581af8015152569bdd2a0e8cc80aa35a3b928e /content | |
parent | 97eeaa029c90bc17c279fbd6a4a56afe10b14d95 (diff) | |
download | chromium_src-b283d295de80df36c95121468beeba0f9c23b504.zip chromium_src-b283d295de80df36c95121468beeba0f9c23b504.tar.gz chromium_src-b283d295de80df36c95121468beeba0f9c23b504.tar.bz2 |
Add a method to RenderViewImpl to retrieve the length of the session history
We need this information to implement the WebTestDelegate interface.
BUG=111316
R=creis@chromium.org
Review URL: https://codereview.chromium.org/12319014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/public/test/layouttest_support.h | 3 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 4 | ||||
-rw-r--r-- | content/renderer/render_view_impl.h | 5 | ||||
-rw-r--r-- | content/shell/webkit_test_runner.cc | 3 | ||||
-rw-r--r-- | content/test/layouttest_support.cc | 5 |
5 files changed, 18 insertions, 2 deletions
diff --git a/content/public/test/layouttest_support.h b/content/public/test/layouttest_support.h index 90a3717..7548d1b 100644 --- a/content/public/test/layouttest_support.h +++ b/content/public/test/layouttest_support.h @@ -35,6 +35,9 @@ void DisableAppCacheLogging(); // Enable testing support in the devtools client. void EnableDevToolsFrontendTesting(); +// Returns the length of the local session history of a render view. +int GetLocalSessionHistoryLength(RenderView* render_view); + } // namespace content #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index b1ec246..a6a7d07 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -6673,6 +6673,10 @@ skia::RefPtr<SkPicture> RenderViewImpl::CapturePicture() { } #endif +unsigned RenderViewImpl::GetLocalSessionHistoryLengthForTesting() const { + return history_list_length_; +} + void RenderViewImpl::OnReleaseDisambiguationPopupDIB( TransportDIB::Handle dib_handle) { TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index 2e8d256..3242fdb 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -390,6 +390,11 @@ class CONTENT_EXPORT RenderViewImpl void GetWindowSnapshot(const WindowSnapshotCallback& callback); + // Returns the length of the session history of this RenderView. Note that + // this only coincides with the actual length of the session history if this + // RenderView is the currently active RenderView of a WebContents. + unsigned GetLocalSessionHistoryLengthForTesting() const; + // IPC::Listener implementation ---------------------------------------------- virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; diff --git a/content/shell/webkit_test_runner.cc b/content/shell/webkit_test_runner.cc index 0a41aee..fc70b61 100644 --- a/content/shell/webkit_test_runner.cc +++ b/content/shell/webkit_test_runner.cc @@ -357,8 +357,7 @@ void WebKitTestRunner::closeRemainingWindows() { } int WebKitTestRunner::navigationEntryCount() { - // TODO(jochen): implement this. - return 0; + return GetLocalSessionHistoryLength(render_view()); } void WebKitTestRunner::goToOffset(int offset) { diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc index 5cd042b..a0d77b6 100644 --- a/content/test/layouttest_support.cc +++ b/content/test/layouttest_support.cc @@ -56,4 +56,9 @@ void EnableDevToolsFrontendTesting() { DevToolsClient::EnableDevToolsFrontendTesting(); } +int GetLocalSessionHistoryLength(RenderView* render_view) { + return static_cast<RenderViewImpl*>(render_view) + ->GetLocalSessionHistoryLengthForTesting(); +} + } // namespace content |