 Chromium Code Reviews
 Chromium Code Reviews Issue 2720543002:
  Fix headless_browsertests failures with PlzNavigate.  (Closed)
    
  
    Issue 2720543002:
  Fix headless_browsertests failures with PlzNavigate.  (Closed) 
  | Index: headless/test/headless_browser_test.cc | 
| diff --git a/headless/test/headless_browser_test.cc b/headless/test/headless_browser_test.cc | 
| index 53e2db2ba0f633d3ab9ab05ec3acbb8a667ef560..61388383a8b780d0a7d2b7cf9d2be08a1350ce62 100644 | 
| --- a/headless/test/headless_browser_test.cc | 
| +++ b/headless/test/headless_browser_test.cc | 
| @@ -11,7 +11,9 @@ | 
| #include "content/public/browser/browser_thread.h" | 
| #include "content/public/browser/render_process_host.h" | 
| #include "content/public/common/url_constants.h" | 
| +#include "content/public/test/test_navigation_observer.h" | 
| #include "headless/lib/browser/headless_browser_impl.h" | 
| +#include "headless/lib/browser/headless_web_contents_impl.h" | 
| #include "headless/lib/headless_content_main_delegate.h" | 
| #include "headless/public/devtools/domains/runtime.h" | 
| #include "headless/public/headless_devtools_client.h" | 
| @@ -157,9 +159,12 @@ HeadlessBrowser::Options* HeadlessBrowserTest::options() const { | 
| } | 
| bool HeadlessBrowserTest::WaitForLoad(HeadlessWebContents* web_contents) { | 
| - SynchronousLoadObserver load_observer(this, web_contents); | 
| - RunAsynchronousTest(); | 
| - return load_observer.navigation_succeeded(); | 
| + HeadlessWebContentsImpl* web_contents_impl = | 
| + HeadlessWebContentsImpl::From(web_contents); | 
| + content::TestNavigationObserver observer(web_contents_impl->web_contents(), | 
| 
Sami
2017/02/27 11:46:19
This part makes me a little nervous: if we can't r
 
jam
2017/02/27 15:18:18
The main difference with PlzNavigate, due to the b
 
Sami
2017/02/27 16:22:53
I see, thanks for the explanation. I wonder if the
 
jam
2017/02/27 16:29:43
I'm not really sure I understand this comment, sor
 
Sami
2017/02/27 16:36:39
Sorry for being vague: I fully trust this specific
 
jam
2017/02/27 16:52:57
ah, got it, thanks.
An example of this scenario i
 
jam
2017/02/27 16:53:45
oh, and if course, if all a user of headless cares
 
Sami
2017/02/27 17:33:02
Alright, thanks for the explanation. The intermedi
 | 
| + 1); | 
| + observer.Wait(); | 
| + return observer.last_navigation_succeeded(); | 
| } | 
| std::unique_ptr<runtime::EvaluateResult> HeadlessBrowserTest::EvaluateScript( |