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

Unified Diff: chrome/browser/component_updater/sth_set_component_installer_unittest.cc

Issue 2014573002: Certificate Transparency: Wire the TreeStateTracker up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Lei's comments Created 4 years, 7 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 | « chrome/browser/component_updater/sth_set_component_installer.cc ('k') | chrome/browser/io_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/sth_set_component_installer_unittest.cc
diff --git a/chrome/browser/component_updater/sth_set_component_installer_unittest.cc b/chrome/browser/component_updater/sth_set_component_installer_unittest.cc
index 5b6b1014df17374c4b0da5d2798a54aa5b501ef5..d965fc0ad2a246676d97b670daaea4c2d70869e4 100644
--- a/chrome/browser/component_updater/sth_set_component_installer_unittest.cc
+++ b/chrome/browser/component_updater/sth_set_component_installer_unittest.cc
@@ -44,9 +44,8 @@ class STHSetComponentInstallerTest : public PlatformTest {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- std::unique_ptr<StoringSTHObserver> observer(new StoringSTHObserver());
- observer_ = observer.get();
- traits_.reset(new STHSetComponentInstallerTraits(std::move(observer)));
+ observer_.reset(new StoringSTHObserver());
+ traits_.reset(new STHSetComponentInstallerTraits(observer_.get()));
}
void WriteSTHToFile(const std::string& sth_json,
@@ -82,8 +81,10 @@ class STHSetComponentInstallerTest : public PlatformTest {
content::TestBrowserThreadBundle thread_bundle_;
base::ScopedTempDir temp_dir_;
+ std::unique_ptr<StoringSTHObserver> observer_;
+ // |traits_| should be destroyed before the |observer_| as it holds a pointer
+ // to it.
std::unique_ptr<STHSetComponentInstallerTraits> traits_;
- StoringSTHObserver* observer_;
safe_json::TestingJsonParser::ScopedFactoryOverride factory_override_;
private:
« no previous file with comments | « chrome/browser/component_updater/sth_set_component_installer.cc ('k') | chrome/browser/io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698