summaryrefslogtreecommitdiffstats
path: root/content/shell/layout_test_controller.h
blob: 22171ac2fa2edd8a14f6b456161c4c6c19195d3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_SHELL_LAYOUT_TEST_CONTROLLER_H_
#define CONTENT_SHELL_LAYOUT_TEST_CONTROLLER_H_
#pragma once

#include "content/public/renderer/render_view_observer.h"

namespace content {

// This is the renderer side of the layout test controller.
class LayoutTestController : public RenderViewObserver {
 public:
  explicit LayoutTestController(RenderView* render_view);
  virtual ~LayoutTestController();

  // RenderViewObserver implementation.
  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
  virtual void DidClearWindowObject(WebKit::WebFrame* frame) OVERRIDE;
  virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE;

 private:
  // Message handlers.
  void OnCaptureTextDump(bool as_text, bool printing, bool recursive);
  void OnCaptureImageDump(const std::string& expected_pixel_hash);

  DISALLOW_COPY_AND_ASSIGN(LayoutTestController);
};

}  // namespace content

#endif  // CONTENT_SHELL_LAYOUT_TEST_CONTROLLER_H_