From 7bb810979a2e941851d2dad195b80cc36fe8e4e3 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 25 May 2022 16:42:41 +0300 Subject: [PATCH] ceftests: Minor code cleanup --- tests/ceftests/cors_unittest.cc | 5 +---- tests/ceftests/test_handler.cc | 8 -------- tests/ceftests/test_handler.h | 6 +----- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/tests/ceftests/cors_unittest.cc b/tests/ceftests/cors_unittest.cc index b4d3f2404..2eb910c9d 100644 --- a/tests/ceftests/cors_unittest.cc +++ b/tests/ceftests/cors_unittest.cc @@ -299,8 +299,7 @@ class TestServerObserver : public test_server::ObserverHelper { base::OnceClosure done_callback) : setup_(setup), ready_callback_(std::move(ready_callback)), - done_callback_(std::move(done_callback)), - weak_ptr_factory_(this) { + done_callback_(std::move(done_callback)) { DCHECK(setup); Initialize(); } @@ -343,8 +342,6 @@ class TestServerObserver : public test_server::ObserverHelper { base::OnceClosure ready_callback_; base::OnceClosure done_callback_; - base::WeakPtrFactory weak_ptr_factory_; - DISALLOW_COPY_AND_ASSIGN(TestServerObserver); }; diff --git a/tests/ceftests/test_handler.cc b/tests/ceftests/test_handler.cc index fed752eac..ad1005458 100644 --- a/tests/ceftests/test_handler.cc +++ b/tests/ceftests/test_handler.cc @@ -385,14 +385,6 @@ void TestHandler::CloseBrowser(CefRefPtr browser, browser->GetHost()->CloseBrowser(force_close); } -void TestHandler::AddResource(const std::string& url, - const std::string& content, - const std::string& mime_type) { - ResourceContent::HeaderMap headerMap = ResourceContent::HeaderMap(); - ResourceContent rc = ResourceContent(content, mime_type, headerMap); - AddResourceEx(url, rc); -} - void TestHandler::AddResource(const std::string& url, const std::string& content, const std::string& mime_type, diff --git a/tests/ceftests/test_handler.h b/tests/ceftests/test_handler.h index aa862b1ce..afb213e1f 100644 --- a/tests/ceftests/test_handler.h +++ b/tests/ceftests/test_handler.h @@ -233,14 +233,10 @@ class TestHandler : public CefClient, CefRefPtr extra_info = nullptr); static void CloseBrowser(CefRefPtr browser, bool force_close); - void AddResource(const std::string& url, - const std::string& content, - const std::string& mime_type); - void AddResource(const std::string& url, const std::string& content, const std::string& mime_type, - const ResourceContent::HeaderMap& header_map); + const ResourceContent::HeaderMap& header_map = {}); void AddResourceEx(const std::string& url, const ResourceContent& content);