diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-28 06:51:42 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-28 06:51:42 +0000 |
commit | 5ff8b2aa66ed64f18794cfb130284bb54eb00ce4 (patch) | |
tree | e411d23a1b3144aad9819741adb7154ef2b0ac3c /chrome/browser/browsing_data | |
parent | 3945dcb435eb9ebcad8ba582663fd50cb8a59126 (diff) | |
download | chromium_src-5ff8b2aa66ed64f18794cfb130284bb54eb00ce4.zip chromium_src-5ff8b2aa66ed64f18794cfb130284bb54eb00ce4.tar.gz chromium_src-5ff8b2aa66ed64f18794cfb130284bb54eb00ce4.tar.bz2 |
Cleanup storage_partition_impl_unittest.cc.
Removes:
- unnecessary casts
- unnecessary conversions to pointers
- unnecessary wrapper over RunLoop.
It also removes stack-based creation of the StoragePartition and temp
directories. This was fragile and unnecessary. The TestBrowserContext itself
already created a default one. The stack-based version was actually coopting
contexts that were created in the default partition to create a partial
stub. This unfortunately also avoided most of the initialization code and
checks in the StoragePartitionImpl::Create() function leading to more
fragility.
Now, each test case only has one default StoragePartition which is correctly
tied to the containing BrowserContext. The contexts in this partition are
also no longer shared by the stubs.
TBR=boliu
BUG=none
Review URL: https://codereview.chromium.org/101423007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data')
-rw-r--r-- | chrome/browser/browsing_data/browsing_data_remover.cc | 2 | ||||
-rw-r--r-- | chrome/browser/browsing_data/browsing_data_remover_unittest.cc | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc index 22785dc..b0511ee 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.cc +++ b/chrome/browser/browsing_data/browsing_data_remover.cc @@ -591,7 +591,7 @@ void BrowsingDataRemover::RemoveImpl(int remove_mask, storage_partition->ClearData( storage_partition_remove_mask, quota_storage_remove_mask, - &remove_origin_, + remove_origin_, base::Bind(&DoesOriginMatchMask, origin_set_mask_), delete_begin_, delete_end_, diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index 5c9c7e7..09b1002 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc @@ -195,7 +195,7 @@ class TestStoragePartition : public StoragePartition { virtual void ClearData(uint32 remove_mask, uint32 quota_storage_remove_mask, - const GURL* storage_origin, + const GURL& storage_origin, const OriginMatcherFunction& origin_matcher, const base::Time begin, const base::Time end, @@ -204,8 +204,7 @@ class TestStoragePartition : public StoragePartition { storage_partition_removal_data_.remove_mask = remove_mask; storage_partition_removal_data_.quota_storage_remove_mask = quota_storage_remove_mask; - storage_partition_removal_data_.remove_origin = - storage_origin ? *storage_origin : GURL(); + storage_partition_removal_data_.remove_origin = storage_origin; storage_partition_removal_data_.remove_begin = begin; storage_partition_removal_data_.remove_end = end; storage_partition_removal_data_.origin_matcher = origin_matcher; |