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

Unified Diff: headless/lib/headless_web_contents_browsertest.cc

Issue 2507003002: Enable security state computation for HeadlessWebContents. (Closed)
Patch Set: fix copyright Created 4 years, 1 month 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/headless_web_contents_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_web_contents_browsertest.cc
diff --git a/headless/lib/headless_web_contents_browsertest.cc b/headless/lib/headless_web_contents_browsertest.cc
index 7865c77b56b9c7e22e5de22556940d5dc2cc7f12..51f519c9055ca60c29d68c267a75e747025e6dbb 100644
--- a/headless/lib/headless_web_contents_browsertest.cc
+++ b/headless/lib/headless_web_contents_browsertest.cc
@@ -8,6 +8,7 @@
#include "content/public/test/browser_test.h"
#include "headless/public/devtools/domains/page.h"
+#include "headless/public/devtools/domains/security.h"
#include "headless/public/headless_browser.h"
#include "headless/public/headless_devtools_client.h"
#include "headless/public/headless_web_contents.h"
@@ -74,4 +75,25 @@ class HeadlessWebContentsScreenshotTest
HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessWebContentsScreenshotTest);
+class HeadlessWebContentsSecurityTest
+ : public HeadlessAsyncDevTooledBrowserTest,
+ public security::ExperimentalObserver {
+ public:
+ void RunDevTooledTest() override {
+ devtools_client_->GetSecurity()->GetExperimental()->AddObserver(this);
+ devtools_client_->GetSecurity()->GetExperimental()->Enable(
+ security::EnableParams::Builder().Build());
+ }
+
+ void OnSecurityStateChanged(
+ const security::SecurityStateChangedParams& params) override {
+ EXPECT_EQ(security::SecurityState::NEUTRAL, params.GetSecurityState());
+ EXPECT_TRUE(params.HasExplanations());
+
+ FinishAsynchronousTest();
+ }
+};
+
+HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessWebContentsSecurityTest);
+
} // namespace headless
« no previous file with comments | « headless/lib/browser/headless_web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698