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

Side by Side Diff: headless/lib/headless_web_contents_browsertest.cc

Issue 2645683005: Make HeadlessWebContentsSecurityTest disable observer before completion. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "content/public/test/browser_test.h" 9 #include "content/public/test/browser_test.h"
10 #include "headless/public/devtools/domains/page.h" 10 #include "headless/public/devtools/domains/page.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void RunDevTooledTest() override { 82 void RunDevTooledTest() override {
83 devtools_client_->GetSecurity()->GetExperimental()->AddObserver(this); 83 devtools_client_->GetSecurity()->GetExperimental()->AddObserver(this);
84 devtools_client_->GetSecurity()->GetExperimental()->Enable( 84 devtools_client_->GetSecurity()->GetExperimental()->Enable(
85 security::EnableParams::Builder().Build()); 85 security::EnableParams::Builder().Build());
86 } 86 }
87 87
88 void OnSecurityStateChanged( 88 void OnSecurityStateChanged(
89 const security::SecurityStateChangedParams& params) override { 89 const security::SecurityStateChangedParams& params) override {
90 EXPECT_EQ(security::SecurityState::NEUTRAL, params.GetSecurityState()); 90 EXPECT_EQ(security::SecurityState::NEUTRAL, params.GetSecurityState());
91 91
92 devtools_client_->GetSecurity()->GetExperimental()->Disable(
93 security::DisableParams::Builder().Build());
94 devtools_client_->GetSecurity()->GetExperimental()->RemoveObserver(this);
92 FinishAsynchronousTest(); 95 FinishAsynchronousTest();
93 } 96 }
94 }; 97 };
95 98
96 HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessWebContentsSecurityTest); 99 HEADLESS_ASYNC_DEVTOOLED_TEST_F(HeadlessWebContentsSecurityTest);
97 100
98 } // namespace headless 101 } // namespace headless
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698