Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: components/web_view/test_frame_tree_delegate.h

Issue 1677293002: Bye bye Mandoline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/web_view/reload_type.h ('k') | components/web_view/test_frame_tree_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_
6 #define COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/web_view/frame_tree_delegate.h"
11
12 namespace base {
13 class RunLoop;
14 }
15
16 namespace mojo {
17 class Shell;
18 }
19
20 namespace web_view {
21
22 class TestFrameTreeDelegate : public FrameTreeDelegate {
23 public:
24 explicit TestFrameTreeDelegate(mojo::Shell* shell);
25 ~TestFrameTreeDelegate() override;
26
27 mojo::Shell* shell() { return shell_; }
28
29 // Runs a message loop until DidCreateFrame() is called, returning the
30 // Frame supplied to DidCreateFrame().
31 Frame* WaitForCreateFrame();
32
33 // Waits for DidDestroyFrame() to be called with |frame|.
34 void WaitForDestroyFrame(Frame* frame);
35
36 // Waits for OnWindowEmbeddedInFrameDisconnected() to be called with |frame|.
37 void WaitForFrameDisconnected(Frame* frame);
38
39 // TestFrameTreeDelegate:
40 scoped_ptr<FrameUserData> CreateUserDataForNewFrame(
41 mojom::FrameClientPtr frame_client) override;
42 bool CanPostMessageEventToFrame(const Frame* source,
43 const Frame* target,
44 mojom::HTMLMessageEvent* event) override;
45 void LoadingStateChanged(bool loading, double progress) override;
46 void TitleChanged(const mojo::String& title) override;
47 void NavigateTopLevel(Frame* source, mojo::URLRequestPtr request) override;
48 void CanNavigateFrame(Frame* target,
49 mojo::URLRequestPtr request,
50 const CanNavigateFrameCallback& callback) override;
51 void DidStartNavigation(Frame* frame) override;
52 void DidCommitProvisionalLoad(Frame* frame) override;
53 void DidNavigateLocally(Frame* source, const GURL& url) override;
54 void DidCreateFrame(Frame* frame) override;
55 void DidDestroyFrame(Frame* frame) override;
56 void OnWindowEmbeddedInFrameDisconnected(Frame* frame) override;
57
58 private:
59 bool is_waiting() const { return run_loop_.get(); }
60
61 mojo::Shell* shell_;
62 bool waiting_for_create_frame_;
63 Frame* waiting_for_destroy_frame_;
64 scoped_ptr<base::RunLoop> run_loop_;
65 Frame* most_recent_frame_;
66 Frame* waiting_for_frame_disconnected_;
67
68 DISALLOW_COPY_AND_ASSIGN(TestFrameTreeDelegate);
69 };
70
71 } // namespace web_view
72
73 #endif // COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/web_view/reload_type.h ('k') | components/web_view/test_frame_tree_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698