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

Unified Diff: headless/test/headless_browser_test.cc

Issue 2181413002: [headless] Remove default browser context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes 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
Index: headless/test/headless_browser_test.cc
diff --git a/headless/test/headless_browser_test.cc b/headless/test/headless_browser_test.cc
index c60e9de7d9ec817e8e618adaacbf1e81820d0212..edf9bab38e648c26d7ae5c4cef27f69db427b469 100644
--- a/headless/test/headless_browser_test.cc
+++ b/headless/test/headless_browser_test.cc
@@ -147,11 +147,6 @@ void HeadlessBrowserTest::RunTestOnMainThreadLoop() {
}
}
-void HeadlessBrowserTest::SetBrowserOptions(HeadlessBrowser::Options options) {
- HeadlessContentMainDelegate::GetInstance()->browser()->SetOptionsForTesting(
- std::move(options));
-}
-
HeadlessBrowser* HeadlessBrowserTest::browser() const {
return HeadlessContentMainDelegate::GetInstance()->browser();
}
@@ -196,7 +191,9 @@ void HeadlessAsyncDevTooledBrowserTest::DevToolsTargetReady() {
}
void HeadlessAsyncDevTooledBrowserTest::RunTest() {
- web_contents_ = browser()->CreateWebContentsBuilder().Build();
+ browser_context_ = browser()->CreateBrowserContextBuilder().Build();
+
+ web_contents_ = browser_context_->CreateWebContentsBuilder().Build();
web_contents_->AddObserver(this);
RunAsynchronousTest();
@@ -205,6 +202,7 @@ void HeadlessAsyncDevTooledBrowserTest::RunTest() {
web_contents_->RemoveObserver(this);
web_contents_->Close();
web_contents_ = nullptr;
+ browser_context_.reset();
}
} // namespace headless
« headless/public/headless_browser.h ('K') | « headless/test/headless_browser_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698