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

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

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_ 5 #ifndef COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_
6 #define COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_ 6 #define COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "components/web_view/frame_tree_delegate.h" 10 #include "components/web_view/frame_tree_delegate.h"
11 11
12 namespace base { 12 namespace base {
13 class RunLoop; 13 class RunLoop;
14 } 14 }
15 15
16 namespace mojo { 16 namespace mojo {
17 class ApplicationImpl; 17 class Shell;
18 } 18 }
19 19
20 namespace web_view { 20 namespace web_view {
21 21
22 class TestFrameTreeDelegate : public FrameTreeDelegate { 22 class TestFrameTreeDelegate : public FrameTreeDelegate {
23 public: 23 public:
24 explicit TestFrameTreeDelegate(mojo::ApplicationImpl* app); 24 explicit TestFrameTreeDelegate(mojo::Shell* shell);
25 ~TestFrameTreeDelegate() override; 25 ~TestFrameTreeDelegate() override;
26 26
27 mojo::ApplicationImpl* app() { return app_; } 27 mojo::Shell* shell() { return shell_; }
28 28
29 // Runs a message loop until DidCreateFrame() is called, returning the 29 // Runs a message loop until DidCreateFrame() is called, returning the
30 // Frame supplied to DidCreateFrame(). 30 // Frame supplied to DidCreateFrame().
31 Frame* WaitForCreateFrame(); 31 Frame* WaitForCreateFrame();
32 32
33 // Waits for DidDestroyFrame() to be called with |frame|. 33 // Waits for DidDestroyFrame() to be called with |frame|.
34 void WaitForDestroyFrame(Frame* frame); 34 void WaitForDestroyFrame(Frame* frame);
35 35
36 // Waits for OnWindowEmbeddedInFrameDisconnected() to be called with |frame|. 36 // Waits for OnWindowEmbeddedInFrameDisconnected() to be called with |frame|.
37 void WaitForFrameDisconnected(Frame* frame); 37 void WaitForFrameDisconnected(Frame* frame);
(...skipping 13 matching lines...) Expand all
51 void DidStartNavigation(Frame* frame) override; 51 void DidStartNavigation(Frame* frame) override;
52 void DidCommitProvisionalLoad(Frame* frame) override; 52 void DidCommitProvisionalLoad(Frame* frame) override;
53 void DidNavigateLocally(Frame* source, const GURL& url) override; 53 void DidNavigateLocally(Frame* source, const GURL& url) override;
54 void DidCreateFrame(Frame* frame) override; 54 void DidCreateFrame(Frame* frame) override;
55 void DidDestroyFrame(Frame* frame) override; 55 void DidDestroyFrame(Frame* frame) override;
56 void OnWindowEmbeddedInFrameDisconnected(Frame* frame) override; 56 void OnWindowEmbeddedInFrameDisconnected(Frame* frame) override;
57 57
58 private: 58 private:
59 bool is_waiting() const { return run_loop_.get(); } 59 bool is_waiting() const { return run_loop_.get(); }
60 60
61 mojo::ApplicationImpl* app_; 61 mojo::Shell* shell_;
62 bool waiting_for_create_frame_; 62 bool waiting_for_create_frame_;
63 Frame* waiting_for_destroy_frame_; 63 Frame* waiting_for_destroy_frame_;
64 scoped_ptr<base::RunLoop> run_loop_; 64 scoped_ptr<base::RunLoop> run_loop_;
65 Frame* most_recent_frame_; 65 Frame* most_recent_frame_;
66 Frame* waiting_for_frame_disconnected_; 66 Frame* waiting_for_frame_disconnected_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(TestFrameTreeDelegate); 68 DISALLOW_COPY_AND_ASSIGN(TestFrameTreeDelegate);
69 }; 69 };
70 70
71 } // namespace web_view 71 } // namespace web_view
72 72
73 #endif // COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_ 73 #endif // COMPONENTS_WEB_VIEW_TEST_FRAME_TREE_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/web_view/public/cpp/web_view.cc ('k') | components/web_view/test_frame_tree_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698