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

Unified Diff: components/dom_distiller/core/distiller_unittest.cc

Issue 2712413002: Remove ScopedVector in //components/dom_distiller/ (Closed)
Patch Set: Remove ScopedVector in //components/dom_distiller/ Created 3 years, 10 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: components/dom_distiller/core/distiller_unittest.cc
diff --git a/components/dom_distiller/core/distiller_unittest.cc b/components/dom_distiller/core/distiller_unittest.cc
index 6e91ce812d97cec53a021ef648ece9e15d86a09d..b7eaf9b6004f23ac48d0314c4abe0654c64e326c 100644
--- a/components/dom_distiller/core/distiller_unittest.cc
+++ b/components/dom_distiller/core/distiller_unittest.cc
@@ -101,7 +101,7 @@ struct MultipageDistillerData {
vector<string> content;
vector<vector<int> > image_ids;
// The Javascript values returned by mock distiller.
- ScopedVector<base::Value> distilled_values;
+ std::vector<std::unique_ptr<base::Value>> distilled_values;
private:
DISALLOW_COPY_AND_ASSIGN(MultipageDistillerData);
@@ -176,7 +176,7 @@ CreateMultipageDistillerDataWithoutImages(size_t pages_size) {
CreateDistilledValueReturnedFromJS(kTitle, result->content[page_num],
result->image_ids[page_num],
next_page_url, prev_page_url);
- result->distilled_values.push_back(distilled_value.release());
+ result->distilled_values.push_back(std::move(distilled_value));
}
return result;
}
@@ -335,7 +335,8 @@ std::unique_ptr<DistillerPage> CreateMockDistillerPages(
GURL url = GURL(distiller_data->page_urls[page]);
EXPECT_CALL(*distiller_page, DistillPageImpl(url, _))
.WillOnce(DistillerPageOnDistillationDone(
- distiller_page, url, distiller_data->distilled_values[page]));
+ distiller_page, url,
+ distiller_data->distilled_values[page].get()));
}
}
return std::unique_ptr<DistillerPage>(distiller_page);
@@ -492,7 +493,7 @@ TEST_F(DistillerTest, CheckMaxPageLimitExtraPage) {
vector<int>(), "", distiller_data->page_urls[kMaxPagesInArticle - 2]);
distiller_data->distilled_values.pop_back();
- distiller_data->distilled_values.push_back(last_page_data.release());
+ distiller_data->distilled_values.push_back(std::move(last_page_data));
distiller_.reset(
new DistillerImpl(url_fetcher_factory_, DomDistillerOptions()));
@@ -554,7 +555,7 @@ TEST_F(DistillerTest, MultiplePagesDistillationFailure) {
distiller_data->distilled_values.begin() + failed_page_num);
distiller_data->distilled_values.insert(
distiller_data->distilled_values.begin() + failed_page_num,
- base::Value::CreateNullValue().release());
+ base::Value::CreateNullValue());
// Expect only calls till the failed page number.
distiller_.reset(
new DistillerImpl(url_fetcher_factory_, DomDistillerOptions()));
@@ -585,7 +586,7 @@ TEST_F(DistillerTest, DistillMultiplePagesFirstEmpty) {
distiller_data->distilled_values.begin() + empty_page_num);
distiller_data->distilled_values.insert(
distiller_data->distilled_values.begin() + empty_page_num,
- distilled_value.release());
+ std::move(distilled_value));
distiller_.reset(
new DistillerImpl(url_fetcher_factory_, DomDistillerOptions()));
@@ -616,7 +617,7 @@ TEST_F(DistillerTest, DistillMultiplePagesSecondEmpty) {
distiller_data->distilled_values.begin() + empty_page_num);
distiller_data->distilled_values.insert(
distiller_data->distilled_values.begin() + empty_page_num,
- distilled_value.release());
+ std::move(distilled_value));
distiller_.reset(
new DistillerImpl(url_fetcher_factory_, DomDistillerOptions()));

Powered by Google App Engine
This is Rietveld 408576698