#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_client.h"
#include "content/public/common/page_state.h"
-#include "content/test/test_backing_store.h"
+#include "content/public/common/web_preferences.h"
+#include "content/test/test_render_frame_host.h"
#include "content/test/test_web_contents.h"
#include "media/base/video_frame.h"
#include "ui/gfx/rect.h"
-#include "webkit/common/webpreferences.h"
namespace content {
-namespace {
-
-const int64 kFrameId = 13UL;
-
-} // namespace
-
-
void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params,
int page_id,
const GURL& url,
- PageTransition transition) {
+ ui::PageTransition transition) {
params->page_id = page_id;
params->url = url;
params->referrer = Referrer();
return NULL;
}
+gfx::Vector2dF TestRenderWidgetHostView::GetLastScrollOffset() const {
+ return gfx::Vector2dF();
+}
+
gfx::NativeView TestRenderWidgetHostView::GetNativeView() const {
return NULL;
}
return NULL;
}
+ui::TextInputClient* TestRenderWidgetHostView::GetTextInputClient() {
+ return &text_input_client_;
+}
+
bool TestRenderWidgetHostView::HasFocus() const {
return true;
}
return gfx::Rect();
}
-BackingStore* TestRenderWidgetHostView::AllocBackingStore(
- const gfx::Size& size) {
- return new TestBackingStore(rwh_, size);
-}
-
void TestRenderWidgetHostView::CopyFromCompositingSurface(
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
- const base::Callback<void(bool, const SkBitmap&)>& callback,
- const SkBitmap::Config config) {
+ CopyFromCompositingSurfaceCallback& callback,
+ const SkColorType color_type) {
callback.Run(false, SkBitmap());
}
return false;
}
-void TestRenderWidgetHostView::OnAcceleratedCompositingStateChange() {
-}
-
void TestRenderWidgetHostView::AcceleratedSurfaceInitialized(int host_id,
int route_id) {
}
return gfx::Rect();
}
-#if defined(TOOLKIT_GTK)
-GdkEventButton* TestRenderWidgetHostView::GetLastMouseDown() {
- return NULL;
-}
-
-gfx::NativeView TestRenderWidgetHostView::BuildInputMethodsGtkMenu() {
- return NULL;
-}
-#endif // defined(TOOLKIT_GTK)
-
void TestRenderWidgetHostView::OnSwapCompositorFrame(
uint32 output_surface_id,
scoped_ptr<cc::CompositorFrame> frame) {
// constructor, and deletes itself when TestRenderWidgetHostView::Destroy() is
// called.
new TestRenderWidgetHostView(this);
-
- main_frame_id_ = kFrameId;
}
TestRenderViewHost::~TestRenderViewHost() {
bool TestRenderViewHost::CreateRenderView(
const base::string16& frame_name,
int opener_route_id,
- int32 max_page_id) {
+ int proxy_route_id,
+ int32 max_page_id,
+ bool window_was_created_with_opener) {
DCHECK(!render_view_created_);
render_view_created_ = true;
opener_route_id_ = opener_route_id;
return render_view_created_;
}
+bool TestRenderViewHost::IsFullscreen() const {
+ return RenderViewHostImpl::IsFullscreen();
+}
+
void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) {
main_render_frame_host_->SendNavigate(page_id, url);
}
void TestRenderViewHost::SendNavigateWithTransition(
int page_id,
const GURL& url,
- PageTransition transition) {
+ ui::PageTransition transition) {
main_render_frame_host_->SendNavigateWithTransition(page_id, url, transition);
}
void TestRenderViewHost::SendNavigateWithTransitionAndResponseCode(
int page_id,
const GURL& url,
- PageTransition transition,
+ ui::PageTransition transition,
int response_code) {
main_render_frame_host_->SendNavigateWithTransitionAndResponseCode(
page_id, url, transition, response_code);
void TestRenderViewHost::SendNavigateWithParameters(
int page_id,
const GURL& url,
- PageTransition transition,
+ ui::PageTransition transition,
const GURL& original_request_url,
int response_code,
const base::FilePath* file_path_for_history_item) {
main_render_frame_host_->SendNavigateWithParameters(
page_id, url, transition, original_request_url, response_code,
- file_path_for_history_item);
+ file_path_for_history_item, std::vector<GURL>());
}
-void TestRenderViewHost::SendShouldCloseACK(bool proceed) {
+void TestRenderViewHost::SendBeforeUnloadACK(bool proceed) {
+ // TODO(creis): Move this whole method to TestRenderFrameHost.
base::TimeTicks now = base::TimeTicks::Now();
- OnShouldCloseACK(proceed, now, now);
+ main_render_frame_host_->OnBeforeUnloadACK(proceed, now, now);
}
void TestRenderViewHost::SetContentsMimeType(const std::string& mime_type) {
}
void TestRenderViewHost::SimulateWasShown() {
- WasShown();
+ WasShown(ui::LatencyInfo());
}
void TestRenderViewHost::TestOnStartDragging(
}
void TestRenderViewHost::TestOnUpdateStateWithFile(
- int process_id,
+ int page_id,
const base::FilePath& file_path) {
- OnUpdateState(process_id,
+ OnUpdateState(page_id,
PageState::CreateForTesting(GURL("http://www.google.com"),
false,
"data",
}
TestRenderViewHost* RenderViewHostImplTestHarness::test_rvh() {
- return static_cast<TestRenderViewHost*>(rvh());
+ return contents()->GetRenderViewHost();
}
TestRenderViewHost* RenderViewHostImplTestHarness::pending_test_rvh() {
- return static_cast<TestRenderViewHost*>(pending_rvh());
+ return contents()->GetPendingMainFrame() ?
+ contents()->GetPendingMainFrame()->GetRenderViewHost() :
+ NULL;
}
TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() {
}
TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() {
- return static_cast<TestRenderFrameHost*>(main_rfh());
+ return contents()->GetMainFrame();
}
TestWebContents* RenderViewHostImplTestHarness::contents() {