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

Unified Diff: headless/lib/embedder_mojo_browsertest.cc

Issue 2720543002: Fix headless_browsertests failures with PlzNavigate. (Closed)
Patch Set: without PlzNavigate Created 3 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 side-by-side diff with in-line comments
Download patch
Index: headless/lib/embedder_mojo_browsertest.cc
diff --git a/headless/lib/embedder_mojo_browsertest.cc b/headless/lib/embedder_mojo_browsertest.cc
index 51cc2cb63ff1dac58997bf6ab078f63ce90ed5e7..17ce6ebac217e752b08934b8abdb65412ef1551d 100644
--- a/headless/lib/embedder_mojo_browsertest.cc
+++ b/headless/lib/embedder_mojo_browsertest.cc
@@ -5,6 +5,7 @@
#include <memory>
#include "base/optional.h"
#include "base/path_service.h"
+#include "base/run_loop.h"
#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h"
@@ -225,12 +226,16 @@ class HttpDisabledByDefaultWhenMojoBindingsUsed : public EmbedderMojoTest,
}
void RunMojoTest() override {
+ base::RunLoop run_loop;
devtools_client_->GetNetwork()->AddObserver(this);
- devtools_client_->GetNetwork()->Enable();
- }
-
- GURL GetInitialUrl() const override {
- return embedded_test_server()->GetURL("/page_one.html");
+ devtools_client_->GetNetwork()->Enable(run_loop.QuitClosure());
Sami 2017/02/27 11:46:19 nit: It might make sense to add a helper method to
jam 2017/02/27 15:18:18 The issue is that the module that Enable is called
Sami 2017/02/27 16:22:53 Ah, I was just thinking of two helpers like Enable
jam 2017/02/27 16:29:43 The issue is we'd need more as other test use othe
Sami 2017/02/27 16:36:39 Fair enough, it was just a small nit. We'll rethin
+ base::MessageLoop::ScopedNestableTaskAllower nest_loop(
+ base::MessageLoop::current());
+ run_loop.Run();
+ devtools_client_->GetPage()->AddObserver(this);
+ devtools_client_->GetPage()->Enable();
+ devtools_client_->GetPage()->Navigate(
+ embedded_test_server()->GetURL("/page_one.html").spec());
}
void ReturnTestResult(const std::string& result) override {

Powered by Google App Engine
This is Rietveld 408576698