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

Unified Diff: headless/lib/headless_devtools_client_browsertest.cc

Issue 2278123002: headless: Ensure all commands have parameters and return types (Closed)
Patch Set: Created 4 years, 4 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
« no previous file with comments | « headless/lib/browser/domain_h.template ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_devtools_client_browsertest.cc
diff --git a/headless/lib/headless_devtools_client_browsertest.cc b/headless/lib/headless_devtools_client_browsertest.cc
index 389d7cd110652dd1e3b19ef902103e17b2d6ee90..5188e74c40467068f8221c9eec9e86d4ae87baf2 100644
--- a/headless/lib/headless_devtools_client_browsertest.cc
+++ b/headless/lib/headless_devtools_client_browsertest.cc
@@ -192,6 +192,11 @@ class HeadlessDevToolsClientExperimentalTest
.SetEnabled(false)
.Build());
+ // Check that a previously experimental command which takes no parameters
+ // still works by giving it a parameter object.
+ devtools_client_->GetRuntime()->GetExperimental()->RunIfWaitingForDebugger(
+ runtime::RunIfWaitingForDebuggerParams::Builder().Build());
+
devtools_client_->GetPage()->GetExperimental()->AddObserver(this);
devtools_client_->GetPage()->Enable();
devtools_client_->GetPage()->Navigate(
@@ -200,8 +205,15 @@ class HeadlessDevToolsClientExperimentalTest
void OnFrameStoppedLoading(
const page::FrameStoppedLoadingParams& params) override {
- FinishAsynchronousTest();
+ // Check that a non-experimental command which has no return value can be
+ // called with a void() callback.
+ devtools_client_->GetPage()->Reload(
+ page::ReloadParams::Builder().Build(),
+ base::Bind(&HeadlessDevToolsClientExperimentalTest::OnReloadStarted,
+ base::Unretained(this)));
}
+
+ void OnReloadStarted() { FinishAsynchronousTest(); }
};
HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessDevToolsClientExperimentalTest);
« no previous file with comments | « headless/lib/browser/domain_h.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698