| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ | 5 #ifndef CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ |
| 6 #define CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ | 6 #define CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 void Wait(); | 37 void Wait(); |
| 38 | 38 |
| 39 // Runs a nested message loop and blocks until the navigation in the | 39 // Runs a nested message loop and blocks until the navigation in the |
| 40 // associated FrameTreeNode has committed. | 40 // associated FrameTreeNode has committed. |
| 41 void WaitForCommit(); | 41 void WaitForCommit(); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // WebContentsObserver | 44 // WebContentsObserver |
| 45 void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host, | 45 void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host, |
| 46 const GURL& validated_url, | 46 const GURL& validated_url, |
| 47 bool is_error_page, | 47 bool is_error_page) override; |
| 48 bool is_iframe_srcdoc) override; | |
| 49 void DidCommitProvisionalLoadForFrame( | 48 void DidCommitProvisionalLoadForFrame( |
| 50 RenderFrameHost* render_frame_host, | 49 RenderFrameHost* render_frame_host, |
| 51 const GURL& url, | 50 const GURL& url, |
| 52 ui::PageTransition transition_type) override; | 51 ui::PageTransition transition_type) override; |
| 53 void DidStopLoading() override; | 52 void DidStopLoading() override; |
| 54 | 53 |
| 55 // The id of the FrameTreeNode in which navigations are peformed. | 54 // The id of the FrameTreeNode in which navigations are peformed. |
| 56 int frame_tree_node_id_; | 55 int frame_tree_node_id_; |
| 57 | 56 |
| 58 // If true the navigation has started. | 57 // If true the navigation has started. |
| 59 bool navigation_started_; | 58 bool navigation_started_; |
| 60 | 59 |
| 61 // If true, the navigation has committed. | 60 // If true, the navigation has committed. |
| 62 bool has_committed_; | 61 bool has_committed_; |
| 63 | 62 |
| 64 // If true, this object is waiting for commit only, not for the full load | 63 // If true, this object is waiting for commit only, not for the full load |
| 65 // of the document. | 64 // of the document. |
| 66 bool wait_for_commit_; | 65 bool wait_for_commit_; |
| 67 | 66 |
| 68 // The MessageLoopRunner used to spin the message loop. | 67 // The MessageLoopRunner used to spin the message loop. |
| 69 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 68 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
| 70 | 69 |
| 71 DISALLOW_COPY_AND_ASSIGN(TestFrameNavigationObserver); | 70 DISALLOW_COPY_AND_ASSIGN(TestFrameNavigationObserver); |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } // namespace content | 73 } // namespace content |
| 75 | 74 |
| 76 #endif // CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ | 75 #endif // CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ |
| OLD | NEW |