summaryrefslogtreecommitdiffstats
path: root/content/test/test_render_frame.h
blob: 0976f7822774a9edcad66ad8453454314310a182 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2015 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_TEST_TEST_RENDER_FRAME_H_
#define CONTENT_TEST_TEST_RENDER_FRAME_H_

#include "base/macros.h"
#include "content/renderer/render_frame_impl.h"

namespace blink {
class WebHistoryItem;
}

namespace content {

class RenderViewImpl;
struct CommonNavigationParams;
struct RequestNavigationParams;
struct StartNavigationParams;

// A test class to use in RenderViewTests.
class TestRenderFrame : public RenderFrameImpl {
 public:
  static RenderFrameImpl* CreateTestRenderFrame(
      const RenderFrameImpl::CreateParams& params);
  ~TestRenderFrame() override;

  const blink::WebHistoryItem& current_history_item() {
    return current_history_item_;
  }

  void Navigate(const CommonNavigationParams& common_params,
                const StartNavigationParams& start_params,
                const RequestNavigationParams& request_params);
  void SwapOut(int proxy_routing_id,
               bool is_loading,
               const FrameReplicationState& replicated_frame_state);
  void SetEditableSelectionOffsets(int start, int end);
  void ExtendSelectionAndDelete(int before, int after);
  void Unselect();
  void SetAccessibilityMode(AccessibilityMode new_mode);
  void SetCompositionFromExistingText(
      int start,
      int end,
      const std::vector<blink::WebCompositionUnderline>& underlines);

 private:
  explicit TestRenderFrame(const RenderFrameImpl::CreateParams& params);
  DISALLOW_COPY_AND_ASSIGN(TestRenderFrame);
};

}  // namespace content

#endif  // CONTENT_TEST_TEST_RENDER_FRAME_H_