Chromium Code Reviews| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "content/public/test/test_utils.h" | 15 #include "content/public/test/test_utils.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class FrameTreeNode; | 20 class RenderFrameHost; |
| 21 class WebContents; | |
| 22 | 21 |
| 23 // For content_browsertests, which run on the UI thread, run a second | 22 // For content_browsertests, which run on the UI thread, run a second |
|
ncarter (slow)
2016/11/11 20:56:36
This comment needs to be updated slightly, since i
Łukasz Anforowicz
2016/11/14 17:53:22
Ooops. Done.
I got rid of the UI thread comment,
| |
| 24 // MessageLoop and quit when the navigation in a specific frame (and all of its | 23 // MessageLoop and quit when the navigation in a specific frame (and all of its |
| 25 // subframes) has completed loading. | 24 // subframes) has completed loading. |
| 26 class TestFrameNavigationObserver : public WebContentsObserver { | 25 class TestFrameNavigationObserver : public WebContentsObserver { |
| 27 public: | 26 public: |
| 28 // Create and register a new TestFrameNavigationObserver which will track | 27 // Create and register a new TestFrameNavigationObserver which will track |
| 29 // navigations performed in the specified |node| of the frame tree. | 28 // navigations performed in the specified |frame|. |
|
ncarter (slow)
2016/11/11 20:56:36
Navigation might actually destroy |frame| (if it t
Łukasz Anforowicz
2016/11/14 17:53:22
Done (+ tried to wordsmith in a way that distingui
| |
| 30 explicit TestFrameNavigationObserver(FrameTreeNode* node); | 29 explicit TestFrameNavigationObserver(RenderFrameHost* frame); |
|
ncarter (slow)
2016/11/11 20:56:36
Could this be a ToRenderFrameHost? That would allo
Łukasz Anforowicz
2016/11/14 17:53:22
Good idea. Done.
| |
| 31 | 30 |
| 32 ~TestFrameNavigationObserver() override; | 31 ~TestFrameNavigationObserver() override; |
| 33 | 32 |
| 34 // Runs a nested message loop and blocks until the full load has | 33 // Runs a nested message loop and blocks until the full load has |
| 35 // completed. | 34 // completed. |
| 36 void Wait(); | 35 void Wait(); |
| 37 | 36 |
| 38 // Runs a nested message loop and blocks until the navigation in the | 37 // Runs a nested message loop and blocks until the navigation in the |
| 39 // associated FrameTreeNode has committed. | 38 // associated FrameTreeNode has committed. |
| 40 void WaitForCommit(); | 39 void WaitForCommit(); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 66 | 65 |
| 67 // The MessageLoopRunner used to spin the message loop. | 66 // The MessageLoopRunner used to spin the message loop. |
| 68 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 67 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
| 69 | 68 |
| 70 DISALLOW_COPY_AND_ASSIGN(TestFrameNavigationObserver); | 69 DISALLOW_COPY_AND_ASSIGN(TestFrameNavigationObserver); |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 } // namespace content | 72 } // namespace content |
| 74 | 73 |
| 75 #endif // CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ | 74 #endif // CONTENT_TEST_TEST_FRAME_NAVIGATION_OBSERVER_H_ |
| OLD | NEW |